[v9,0/2] gdb: setting BP with multiple locations only displays one location

Message ID 20250324111646.3201607-1-klaus.gerlicher@intel.com
Headers
Series gdb: setting BP with multiple locations only displays one location |

Message

Gerlicher, Klaus March 24, 2025, 11:16 a.m. UTC
  Hi Guinevere, Andrew and all,

This is version 9 of this patch.

V8 can be found here:

https://sourceware.org/pipermail/gdb-patches/2024-November/212886.html

First of @Guinevere, thanks for pinging on my behalf and reminding me of this.

@all, of course many thanks for reviewing and giving feedback.

@Eli, there are some changes to the docs again (since you had already reviewed).

Andrew has left some comments on V8, these are addressed in V9, summed up
as:

Patch 1/2 gdb: extend gdb_breakpoint for multiple locations
(https://inbox.sourceware.org/gdb-patches/87a5a6yuw1.fsf@redhat.com/)
1) > +	{inferior ""} this was accidently added, removed
2) Changed use of $extra as suggested.
3) There's also one test failure for which I had to change one of the
regexes in gdb_breakpoint: readline-commands-eof.exp. To me it looks
like we were just lucky that the previous regex was matching this.

Patch 2/2 gdb, breakpoint: output multiple bp locations
https://inbox.sourceware.org/gdb-patches/874j0eyr45.fsf@redhat.com/
1) Removed the inferior print.
2) Renamed to set variable to "max-locations-printed"
3) max-locations-printed can now be 0-unlimited, 0 not treated as the latter.
4) Changed the printing code to use a helper for single and multiple locations.

The patches are getting big now since I needed to touch many more locations
to address the request of adding of function name to the output.

I ran this both on x86_64 and aarch64. I'm still a bit scared of having missed
something, so if you spot something odd, please let me know.

Thanks
Klaus

Gerlicher, Klaus (2):
  gdb: extend gdb_breakpoint for multiple locations
  gdb, breakpoint: output multiple bp locations

 gdb/NEWS                                      |   4 +
 gdb/breakpoint.c                              | 123 +++++++++++++----
 gdb/doc/gdb.texinfo                           |  57 +++++++-
 gdb/testsuite/gdb.ada/bp_c_mixed_case.exp     |   3 +-
 gdb/testsuite/gdb.ada/bp_enum_homonym.exp     |   3 +-
 gdb/testsuite/gdb.ada/bp_inlined_func.exp     |   4 +-
 gdb/testsuite/gdb.ada/bp_range_type.exp       |   3 +-
 gdb/testsuite/gdb.ada/bp_reset.exp            |   6 +-
 gdb/testsuite/gdb.ada/fullname_bp.exp         |  12 +-
 gdb/testsuite/gdb.ada/fun_in_declare.exp      |   4 +-
 gdb/testsuite/gdb.ada/homonym.exp             |  16 +--
 gdb/testsuite/gdb.ada/inline-section-gc.exp   |   4 +-
 gdb/testsuite/gdb.ada/nested.exp              |  20 +--
 gdb/testsuite/gdb.ada/operator_bp.exp         |  21 +--
 gdb/testsuite/gdb.ada/task_bp.exp             |   4 +-
 gdb/testsuite/gdb.ada/tasks.exp               |   2 +-
 .../gdb.arch/aarch64-brk-patterns.exp         |   4 +-
 gdb/testsuite/gdb.arch/aarch64-fp.exp         |   4 +-
 gdb/testsuite/gdb.base/annota1.exp            |  13 +-
 gdb/testsuite/gdb.base/annota3.exp            |  11 +-
 gdb/testsuite/gdb.base/break.exp              |   4 +-
 gdb/testsuite/gdb.base/c-linkage-name.exp     |   3 +-
 gdb/testsuite/gdb.base/call-ar-st.exp         |   6 +-
 .../gdb.base/condbreak-multi-context.exp      |  30 ++--
 .../gdb.base/consecutive-step-over.exp        |   4 +-
 gdb/testsuite/gdb.base/consecutive.exp        |   3 +-
 gdb/testsuite/gdb.base/ctxobj.exp             |   4 +-
 gdb/testsuite/gdb.base/dmsym.exp              |   3 +-
 gdb/testsuite/gdb.base/dtrace-probe.exp       |   4 +-
 gdb/testsuite/gdb.base/enum_cond.exp          |   3 +-
 gdb/testsuite/gdb.base/foll-fork.exp          |   7 +-
 gdb/testsuite/gdb.base/fullpath-expand.exp    |   2 +-
 gdb/testsuite/gdb.base/func-ptrs.exp          |  14 +-
 gdb/testsuite/gdb.base/gnu-ifunc.exp          |   4 +-
 gdb/testsuite/gdb.base/hbreak.exp             |   2 +-
 gdb/testsuite/gdb.base/msym-bp-shl.exp        |   4 +-
 gdb/testsuite/gdb.base/msym-bp.exp            |   2 +-
 gdb/testsuite/gdb.base/nested-subp1.exp       |   4 +-
 gdb/testsuite/gdb.base/nested-subp2.exp       |   4 +-
 gdb/testsuite/gdb.base/nested-subp3.exp       |   4 +-
 gdb/testsuite/gdb.base/print-file-var.exp     |   4 +-
 gdb/testsuite/gdb.base/realname-expand.exp    |   4 +-
 gdb/testsuite/gdb.base/recpar.exp             |   4 +-
 .../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/start-cpp.exp          |   4 +-
 gdb/testsuite/gdb.base/step-over-exit.exp     |   2 +-
 gdb/testsuite/gdb.base/watchpoint.exp         |   6 +-
 gdb/testsuite/gdb.cp/annota2.exp              |   2 +-
 gdb/testsuite/gdb.cp/annota3.exp              |   2 +-
 gdb/testsuite/gdb.cp/break-template-cast.exp  |   3 +-
 gdb/testsuite/gdb.cp/breakpoint-locs.exp      |   2 +-
 gdb/testsuite/gdb.cp/bs15503.exp              |   3 +-
 gdb/testsuite/gdb.cp/cp-relocate.exp          |   6 +-
 gdb/testsuite/gdb.cp/cplabel.exp              |   3 +-
 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         |  13 +-
 gdb/testsuite/gdb.cp/meth-typedefs.exp        |   2 +-
 gdb/testsuite/gdb.cp/namespace.exp            |  14 +-
 gdb/testsuite/gdb.cp/ovldbreak.exp            |  16 ++-
 gdb/testsuite/gdb.cp/paramless.exp            |   4 +-
 gdb/testsuite/gdb.cp/pr-1023.exp              |   4 +-
 gdb/testsuite/gdb.cp/templates.exp            |  24 ++--
 gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp    |   4 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp      |   2 +-
 gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp |  20 ++-
 .../gdb.dwarf2/dw2-prologue-end-2.exp         |   2 +-
 .../gdb.dwarf2/dw2-skip-prologue.exp          |   2 +-
 .../gdb.dwarf2/missing-line-table.exp         |   2 +-
 gdb/testsuite/gdb.linespec/break-ask.exp      |   4 +-
 gdb/testsuite/gdb.linespec/break-asm-file.exp |   8 +-
 gdb/testsuite/gdb.linespec/cpcompletion.exp   |   8 ++
 gdb/testsuite/gdb.linespec/linespec.exp       |  36 ++---
 gdb/testsuite/gdb.linespec/ls-dollar.exp      |   6 +-
 gdb/testsuite/gdb.linespec/multiple-locs.cc   |  41 ++++++
 gdb/testsuite/gdb.linespec/multiple-locs.exp  |  57 ++++++++
 .../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        |  27 ++--
 gdb/testsuite/gdb.python/py-bp-locations.exp  |   2 +-
 gdb/testsuite/gdb.python/py-breakpoint.exp    |   5 +-
 gdb/testsuite/gdb.python/py-mi-events.exp     |   2 +-
 gdb/testsuite/gdb.reverse/aarch64-mops.exp    |   6 +-
 .../gdb.reverse/consecutive-precsave.exp      |   2 +-
 .../gdb.reverse/consecutive-reverse.exp       |   2 +-
 gdb/testsuite/gdb.reverse/fstatat-reverse.exp |   8 +-
 gdb/testsuite/gdb.reverse/getrandom.exp       |   4 +-
 .../gdb.reverse/getresuid-reverse.exp         |   4 +-
 gdb/testsuite/gdb.reverse/pipe-reverse.exp    |   4 +-
 gdb/testsuite/gdb.reverse/readv-reverse.exp   |   4 +-
 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp |   4 +-
 gdb/testsuite/gdb.reverse/s390-mvcle.exp      |   4 +-
 gdb/testsuite/gdb.reverse/time-reverse.exp    |   2 +-
 gdb/testsuite/gdb.reverse/waitpid-reverse.exp |   4 +-
 gdb/testsuite/gdb.reverse/watch-precsave.exp  |   4 +-
 gdb/testsuite/gdb.reverse/watch-reverse.exp   |   4 +-
 .../gdb.server/bkpt-other-inferior.exp        |   2 +-
 gdb/testsuite/gdb.server/target-exec-file.exp |   2 +-
 gdb/testsuite/gdb.threads/print-threads.exp   |   6 +-
 gdb/testsuite/gdb.trace/save-trace.exp        |   2 +-
 gdb/testsuite/gdb.trace/tracecmd.exp          |   8 +-
 gdb/testsuite/lib/completion-support.exp      |   7 +-
 gdb/testsuite/lib/gdb.exp                     | 129 +++++++++++++++---
 110 files changed, 614 insertions(+), 449 deletions(-)
 create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.cc
 create mode 100644 gdb/testsuite/gdb.linespec/multiple-locs.exp
  

Comments

Gerlicher, Klaus April 15, 2025, 2:07 p.m. UTC | #1
Hi,

Kindly pinging.

There was one failure on the patchworks ARM server but it's only because I managed to add a piece of change 
to the wrong patch. I will correct this if we agree that it's fine that V9 touches much more tests than V8 because
output consistency needs all the new fixups.

Thanks
Klaus

> -----Original Message-----
> From: Klaus Gerlicher <klaus.gerlicher@intel.com>
> Sent: Monday, March 24, 2025 12:17 PM
> To: gdb-patches@sourceware.org; blarsen@redhat.com;
> aburgess@redhat.com; eliz@gnu.org
> Subject: [PATCH v9 0/2] gdb: setting BP with multiple locations only displays
> one location
> 
> Hi Guinevere, Andrew and all,
> 
> This is version 9 of this patch.
> 
> V8 can be found here:
> 
> https://sourceware.org/pipermail/gdb-patches/2024-
> November/212886.html
> 
> First of @Guinevere, thanks for pinging on my behalf and reminding me of
> this.
> 
> @all, of course many thanks for reviewing and giving feedback.
> 
> @Eli, there are some changes to the docs again (since you had already
> reviewed).
> 
> Andrew has left some comments on V8, these are addressed in V9, summed
> up
> as:
> 
> Patch 1/2 gdb: extend gdb_breakpoint for multiple locations
> (https://inbox.sourceware.org/gdb-patches/87a5a6yuw1.fsf@redhat.com/)
> 1) > +	{inferior ""} this was accidently added, removed
> 2) Changed use of $extra as suggested.
> 3) There's also one test failure for which I had to change one of the
> regexes in gdb_breakpoint: readline-commands-eof.exp. To me it looks
> like we were just lucky that the previous regex was matching this.
> 
> Patch 2/2 gdb, breakpoint: output multiple bp locations
> https://inbox.sourceware.org/gdb-patches/874j0eyr45.fsf@redhat.com/
> 1) Removed the inferior print.
> 2) Renamed to set variable to "max-locations-printed"
> 3) max-locations-printed can now be 0-unlimited, 0 not treated as the latter.
> 4) Changed the printing code to use a helper for single and multiple locations.
> 
> The patches are getting big now since I needed to touch many more locations
> to address the request of adding of function name to the output.
> 
> I ran this both on x86_64 and aarch64. I'm still a bit scared of having missed
> something, so if you spot something odd, please let me know.
> 
> Thanks
> Klaus
> 
<snip>
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
  
Gerlicher, Klaus April 30, 2025, 4 a.m. UTC | #2
Kindly pinging.

Thanks
Klaus

> -----Original Message-----
> From: Gerlicher, Klaus
> Sent: Tuesday, April 15, 2025 4:07 PM
> To: Klaus Gerlicher <klaus.gerlicher@intel.com>; gdb-
> patches@sourceware.org; blarsen@redhat.com; aburgess@redhat.com;
> eliz@gnu.org
> Subject: RE: [PATCH v9 0/2] gdb: setting BP with multiple locations only
> displays one location
> 
> Hi,
> 
> Kindly pinging.
> 
> There was one failure on the patchworks ARM server but it's only because I
> managed to add a piece of change
> to the wrong patch. I will correct this if we agree that it's fine that V9 touches
> much more tests than V8 because
> output consistency needs all the new fixups.
> 
> Thanks
> Klaus
> 
> > -----Original Message-----
> > From: Klaus Gerlicher <klaus.gerlicher@intel.com>
> > Sent: Monday, March 24, 2025 12:17 PM
> > To: gdb-patches@sourceware.org; blarsen@redhat.com;
> > aburgess@redhat.com; eliz@gnu.org
> > Subject: [PATCH v9 0/2] gdb: setting BP with multiple locations only displays
> > one location
> >
> > Hi Guinevere, Andrew and all,
> >
> > This is version 9 of this patch.
> >
> > V8 can be found here:
> >
> > https://sourceware.org/pipermail/gdb-patches/2024-
> > November/212886.html
> >
> > First of @Guinevere, thanks for pinging on my behalf and reminding me of
> > this.
> >
> > @all, of course many thanks for reviewing and giving feedback.
> >
> > @Eli, there are some changes to the docs again (since you had already
> > reviewed).
> >
> > Andrew has left some comments on V8, these are addressed in V9, summed
> > up
> > as:
> >
> > Patch 1/2 gdb: extend gdb_breakpoint for multiple locations
> > (https://inbox.sourceware.org/gdb-
> patches/87a5a6yuw1.fsf@redhat.com/)
> > 1) > +	{inferior ""} this was accidently added, removed
> > 2) Changed use of $extra as suggested.
> > 3) There's also one test failure for which I had to change one of the
> > regexes in gdb_breakpoint: readline-commands-eof.exp. To me it looks
> > like we were just lucky that the previous regex was matching this.
> >
> > Patch 2/2 gdb, breakpoint: output multiple bp locations
> > https://inbox.sourceware.org/gdb-patches/874j0eyr45.fsf@redhat.com/
> > 1) Removed the inferior print.
> > 2) Renamed to set variable to "max-locations-printed"
> > 3) max-locations-printed can now be 0-unlimited, 0 not treated as the latter.
> > 4) Changed the printing code to use a helper for single and multiple
> locations.
> >
> > The patches are getting big now since I needed to touch many more
> locations
> > to address the request of adding of function name to the output.
> >
> > I ran this both on x86_64 and aarch64. I'm still a bit scared of having missed
> > something, so if you spot something odd, please let me know.
> >
> > Thanks
> > Klaus
> >
> <snip>
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