From patchwork Tue Sep 10 07:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Gerlicher X-Patchwork-Id: 57437 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC5EC385842A for ; Tue, 10 Sep 2024 07:14:25 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by sourceware.org (Postfix) with ESMTPS id A86D33858C98 for ; Tue, 10 Sep 2024 07:13:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A86D33858C98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A86D33858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725952440; cv=none; b=N3csnTvxsvriQ/bHrDBzaEFdyt2k1Y87+XQuqB+Akma0gEPUJXMy+eGsUSBk2qDURi9D7wXJDvLg0KnInl4bZlQcIkOoTLi+lnqCYfzWp/Wr6LZLFuxabzhmA/g67ACoCggjugnSJk8NpeOC0Ywt4EBo3ii0x9y2tQXUHPuaQuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725952440; c=relaxed/simple; bh=2jsRD6rvxZK5+H0CyNi8P9AyC1P3raaKwecZHxXSOVY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=UwY1mOqA9+E1O97wi2DXuWTGG3eXArZNk6g60JbkSNUkbPIFG+3hKQCQrLPv0cA7oYBGJ2d0nWqoVgKc5k3oeab3cZBdLxGyVQApgJgJbMftu5S5nmBl9u0OEuR5FO6LIWzC0VbS89OwxUW19NBRRL2gAerNREsKveCg/ty0gHo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725952438; x=1757488438; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=2jsRD6rvxZK5+H0CyNi8P9AyC1P3raaKwecZHxXSOVY=; b=PjJxjKBU5Pk1BJ8whgSd5Gz09W8CdAcInfaChZb1DY7DG9AJ63bLhtSM kg8FFmhWzzP6UqJ4HdAowZW1mnIUeH+hUzVIVRwO1lVxs8phufKs95BJd +CTP1wvKC8MrU76fXdF/hdxL/wezJ7Fp4kp+9QLBH2M26NatHB3kmlvP0 vPIC5pFKbqA0AL39ntlVbBBixCcALWTRsIPkoD/tOpqLmWuRrGJfdQggu ICrQcNztHyY98mNuPSo9L67APHpwEJC9APrnFHxDj15cIIPbOL3gdTUKx PGBdD6gJ6vHbbUKFzOUXYLr1bTJs2vwH2DoznuELxYOHAeMAIXrIntZ/j Q==; X-CSE-ConnectionGUID: AVn4RVRnSEaYesTeiEWqBQ== X-CSE-MsgGUID: jr3CieiiRDqUMmulECTLZw== X-IronPort-AV: E=McAfee;i="6700,10204,11190"; a="24624672" X-IronPort-AV: E=Sophos;i="6.10,216,1719903600"; d="scan'208";a="24624672" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2024 00:13:56 -0700 X-CSE-ConnectionGUID: yOShvfZ6QM+RgiJkO1vE0A== X-CSE-MsgGUID: 8daohZ/6T26gWf2Dpa55Kw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,216,1719903600"; d="scan'208";a="90223275" Received: from dut1513dg2mrb.igk.intel.com (HELO localhost) ([10.102.46.197]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2024 00:13:54 -0700 From: Klaus Gerlicher To: gdb-patches@sourceware.org Subject: [PATCH v3 0/2] gdb: setting BP with multiple locations only displays Date: Tue, 10 Sep 2024 07:13:35 +0000 Message-Id: <20240910071337.1971891-1-klaus.gerlicher@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org From: "Gerlicher, Klaus" Hi Guinevere, all, Thanks for the V2 review. And sorry for the whitespace issues. I changed my workflow to now git format-patch/am the patches which would show such issues, hoping they are now not present. This patch V2 had been reviewed by Guinevere in August and the new series V3 here reflects the suggestions for patch V2. It changes the V2 (https://sourceware.org/pipermail/gdb-patches/2024-August/210906.html) quite a lot, so not all comments from V2 are here. The most important aspect is this: > Since you are already changing these tests, we already have a proc > called gdb_breakpoint(in lib/gdb.exp), which is supposed to more > generically and thoroughly handle setting breakpoints. I think it would > be best to change these generic gdb_test to gdb_breakpoint calls, and > make gdb_breakpoint handle the new multiple breakpoint location. This is > valid for many changes in this email, > However, I won't block this patch on that, if it is too difficult or you > end up needing to change all gdb_breakpoint calls for some reason (I > wouldn't expect it, but I'm not great with expect or TCL, so I might be > missing something). There were some other minor nits that I have addressed or are not relevant to V3 but I hope it is ok to not refer to them again. I have decided to split this into two parts: The 1st patch changes all the current locations where we use gdb_test "break" and expect multiple locations, to using gdb_breakpoint. gdb_breakpoint is changed so it will match multiple breakpoint locations properly. The 2nd patch then adds the new multi-line output for the breakpoint command, adds the set command for maximum locations printed, and modifies all tests that are either impacted by the new set command (list more than 10 locations) or multi-line output. Please note that by changing to gdb_breakpoint we don't have pass prints in the logs anymore. If these are required we could change gdb_breakpoint to output them whenever a "-loc" is specified but I didn't think this was necessary from a personal perspective. Guinevere, you also thought that having a way to specify the actual regex to match could be useful but I didn't find this is needed in any of our cases. There's one MI specific test where the expected output is still handcoded. I imagine the regex generated by gdb_multi_loc_regex could be converted to "~" MI format but I didn't do this here. I'd love to do it in a follow up. As for testing, again I used x86_64 and aarch64 which had the same unexpected failures as a master run: # of unexpected core files 1 # of expected passes 119260 # of unexpected failures 13 # of expected failures 101 # of known failures 123 # of untested testcases 34 # of unresolved testcases 1 # of unsupported tests 440 Thanks Klaus Gerlicher, Klaus (2): gdb: extend gdb_breakpoint for multiple locations gdb, breakpoint: output multiple bp locations gdb/NEWS | 5 + gdb/breakpoint.c | 125 ++++++++++++++---- gdb/doc/gdb.texinfo | 45 ++++++- gdb/testsuite/gdb.ada/bp_inlined_func.exp | 4 +- gdb/testsuite/gdb.ada/homonym.exp | 8 +- gdb/testsuite/gdb.ada/operator_bp.exp | 18 +-- .../gdb.base/condbreak-multi-context.exp | 22 ++- gdb/testsuite/gdb.base/ctxobj.exp | 4 +- gdb/testsuite/gdb.base/dtrace-probe.exp | 4 +- gdb/testsuite/gdb.base/foll-fork.exp | 7 +- gdb/testsuite/gdb.base/msym-bp-shl.exp | 4 +- gdb/testsuite/gdb.base/msym-bp.exp | 2 +- .../run-control-while-bg-execution.exp | 2 +- gdb/testsuite/gdb.base/solib-symbol.exp | 4 +- gdb/testsuite/gdb.base/stap-probe.exp | 8 +- gdb/testsuite/gdb.cp/breakpoint-locs.exp | 2 +- gdb/testsuite/gdb.cp/ena-dis-br-range.exp | 4 +- gdb/testsuite/gdb.cp/mb-ctor.exp | 8 +- gdb/testsuite/gdb.cp/mb-inline.exp | 8 +- gdb/testsuite/gdb.cp/mb-templates.exp | 12 +- gdb/testsuite/gdb.cp/meth-typedefs.exp | 2 +- gdb/testsuite/gdb.cp/ovldbreak.exp | 8 +- gdb/testsuite/gdb.cp/paramless.exp | 4 +- gdb/testsuite/gdb.cp/templates.exp | 20 ++- gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp | 20 ++- .../gdb.dwarf2/dw2-skip-prologue.exp | 2 +- gdb/testsuite/gdb.linespec/break-asm-file.exp | 4 +- gdb/testsuite/gdb.linespec/cpcompletion.exp | 2 + gdb/testsuite/gdb.linespec/linespec.exp | 22 +-- gdb/testsuite/gdb.linespec/multiple-locs.cc | 41 ++++++ gdb/testsuite/gdb.linespec/multiple-locs.exp | 56 ++++++++ .../mi-breakpoint-multiple-locations.exp | 4 +- .../gdb.mi/user-selected-context-sync.exp | 16 +-- .../gdb.multi/bp-thread-specific.exp | 6 +- .../gdb.multi/inferior-specific-bp.exp | 3 +- .../gdb.multi/multi-target-continue.exp | 3 +- .../gdb.multi/multi-target-ping-pong-next.exp | 6 +- gdb/testsuite/gdb.opt/inline-break.exp | 23 ++-- gdb/testsuite/gdb.python/py-bp-locations.exp | 2 +- gdb/testsuite/gdb.python/py-breakpoint.exp | 2 +- gdb/testsuite/lib/completion-support.exp | 3 + gdb/testsuite/lib/gdb.exp | 121 +++++++++++++++-- 42 files changed, 445 insertions(+), 221 deletions(-) create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.cc create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.exp