Message ID | 20240916081930.120134-1-klaus.gerlicher@intel.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> 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 CDEF73858D20 for <patchwork@sourceware.org>; Mon, 16 Sep 2024 08:20:20 +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.11]) by sourceware.org (Postfix) with ESMTPS id 7BCDF3858D20 for <gdb-patches@sourceware.org>; Mon, 16 Sep 2024 08:19:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BCDF3858D20 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 7BCDF3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726474788; cv=none; b=gdsiFcpKVuRFlICPOMyzZHHJjJ3j2vQj8FEYjSFwUnUy0YqCnIYAUDIFXhIYrdX6c8Es15mROIXl/uUFwnw6eUshv7ACWSo/ya0cPQEjg7JUCUWv8nbc3lNC1MVOyz6i8RjhLuL5NQ3v9s3xOGUsETrrhqG4Me3NkGdhxDgBczY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726474788; c=relaxed/simple; bh=wAtizgobT9NQTbMMchr5WCgFu0iiucuD1r0FjSaC/XE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=OcKF81vvurbBjIo21EdZmWzNEZTPYkvSxVUjlQZU0wpZWxNaXm2lT69ojobw8k4jlVbgJOTWRu7G+mRXMeOlITPTBR1jXv25XqPNMUQpiOnCw8nx6tFVoR+k4pVVr5YBVbM8SSoRjPQ2llYgdAVzyeqYWWMww9wtmdkZaytJgYM= 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=1726474784; x=1758010784; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=wAtizgobT9NQTbMMchr5WCgFu0iiucuD1r0FjSaC/XE=; b=kS3anLl87Umkf4dCpoI3M8Pgj5Ag/FhPJwjEBBNaBm3FxOvnk3FnLA9N P5cCN4emFf/+mYV07OGKT4EWnZQRTBJfZ2EfF9wF4j/aTSgAXwwmPESTN 7QP/Frc2XEqDwE0YkchyB0lTlO1iHCs2EDq3E9i2EWgK7MKCgjur78Xyk ZMAtMa0Nme0Wh0WA2STCd1sNEa1S6Iv2W8pCIYa1y3MwTBU/VEtzOBp42 oAxxebV5rL2z7ibL1aJh7sx6jXqVIOAXPsYekL9Z2i8HBDxa3rTDHCQRI YJI8Pl3Jo+m3V3frWE8R/qOJrW67ZTWGJOweApZbYKmvSpRi6VnmG4TCc A==; X-CSE-ConnectionGUID: eQI1T3DwQha4NCKhMDRPcg== X-CSE-MsgGUID: xoCF39u/Q1aHf/PJTK4OAA== X-IronPort-AV: E=McAfee;i="6700,10204,11196"; a="35865644" X-IronPort-AV: E=Sophos;i="6.10,232,1719903600"; d="scan'208";a="35865644" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2024 01:19:42 -0700 X-CSE-ConnectionGUID: I2JJBNORT4SN3kuzoqbKsw== X-CSE-MsgGUID: FfhC4YMgRFGp8bH9lWA4ZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,232,1719903600"; d="scan'208";a="92083547" 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; 16 Sep 2024 01:19:40 -0700 From: Klaus Gerlicher <klaus.gerlicher@intel.com> To: gdb-patches@sourceware.org, blarsen@redhat.com Subject: [PATCH v5 0/2] gdb: setting BP with multiple locations only displays one location Date: Mon, 16 Sep 2024 08:19:28 +0000 Message-Id: <20240916081930.120134-1-klaus.gerlicher@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series |
gdb: setting BP with multiple locations only displays one location
|
|
Message
Klaus Gerlicher
Sept. 16, 2024, 8:19 a.m. UTC
From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com> Hi Guinevere, all, I also had another oversight in V4, Linaro tester was showing that gdb.base/step-over-exit.exp is failing. On my ARM system I don't get two _exit locations but the Linaro tester seems to have debug symbols installed for libc. I had two oversights in V3 of this series, so I'm replacing it with V4. I don't know if this is the right policy, so please let me know if this is typically handled in another way. Adding back most of V3 cover letter here which is still valid, for convenience: 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. 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.base/step-over-exit.exp | 2 +- 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 +++++++++++++++-- 43 files changed, 446 insertions(+), 222 deletions(-) create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.cc create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.exp
Comments
On 9/16/24 5:19 AM, Klaus Gerlicher wrote: > From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com> > > Hi Guinevere, all, > > I also had another oversight in V4, Linaro tester was showing that > gdb.base/step-over-exit.exp is failing. On my ARM system I don't get two _exit > locations but the Linaro tester seems to have debug symbols installed for libc. > > I had two oversights in V3 of this series, so I'm replacing it with V4. I don't > know if this is the right policy, so please let me know if this is typically > handled in another way. > > Adding back most of V3 cover letter here which is still valid, for convenience: > > 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. Hi Klaus, Sorry for the delaying in coming back to this series. I looked over both patches and with the exception of a typo (sent as reply to the relevant patch), these look ok to me. Reviewed-By: Guinevere Larsen <guinevere@redhat.com> I hope they get approved soon, this is a great change!
Thanks Guinevere, I'll address the typo before I push (after I get approval). Klaus > -----Original Message----- > From: Guinevere Larsen <guinevere@redhat.com> > Sent: Friday, September 20, 2024 9:18 PM > To: Gerlicher, Klaus <klaus.gerlicher@intel.com>; gdb- > patches@sourceware.org; blarsen@redhat.com > Subject: Re: [PATCH v5 0/2] gdb: setting BP with multiple locations only > displays one location > > On 9/16/24 5:19 AM, Klaus Gerlicher wrote: > > From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com> > > > > Hi Guinevere, all, > > > > I also had another oversight in V4, Linaro tester was showing that > > gdb.base/step-over-exit.exp is failing. On my ARM system I don't get two > _exit > > locations but the Linaro tester seems to have debug symbols installed for > libc. > > > > I had two oversights in V3 of this series, so I'm replacing it with V4. I don't > > know if this is the right policy, so please let me know if this is typically > > handled in another way. > > > > Adding back most of V3 cover letter here which is still valid, for convenience: > > > > 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. > > Hi Klaus, > > Sorry for the delaying in coming back to this series. I looked over both > patches and with the exception of a typo (sent as reply to the relevant > patch), these look ok to me. Reviewed-By: Guinevere Larsen > <guinevere@redhat.com> > > I hope they get approved soon, this is a great change! > > -- > Cheers, > Guinevere Larsen > She/Her/Hers > > > > > 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.base/step-over-exit.exp | 2 +- > > 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 +++++++++++++++-- > > 43 files changed, 446 insertions(+), 222 deletions(-) > > create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.cc > > create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.exp > > Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928