public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] info breakpoints improvements
@ 2022-05-19 21:55 Pedro Alves
  2022-05-19 21:55 ` [PATCH 1/2] Always show locations for breakpoints & show canonical location spec Pedro Alves
                   ` (3 more replies)
  0 siblings, 4 replies; 39+ messages in thread
From: Pedro Alves @ 2022-05-19 21:55 UTC (permalink / raw)
  To: gdb-patches

The subject of breakpoint line number sliding came up again in an
internal discussion, which reminded me of this WIP patch that I
originally posted here:
https://sourceware.org/pipermail/gdb-patches/2019-June/158638.html

Here's an updated version that is close to ready for merging.  It
needs agreement, and, testsuite adjustments.  Oh, and I realize now,
NEWS entries.  Both patches already contain documentation changes.  I
went through the whole "Set Breaks" chapter fixing up things to better
match current reality as I was documenting the new features.

Patch #1 changes GDB such that instead of:

 (top-gdb) info breakpoints
 1       breakpoint     keep y   0x0000000000575127 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54
 2       breakpoint     keep y   0x0000000000575127 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54
 3       breakpoint     keep y   <MULTIPLE>
 3.1                         y   0x0000000000575127 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54
 3.2                         y   0x00007ffff6d50410 in PyErr_SetObject at /usr/src/debug/python2-2.7.15-4.fc27.x86_64/Python/errors.c:54
 4       breakpoint     keep y   0x000055555564107b in main(int, char**) at src/gdb/gdb.c:28
 (top-gdb)

we get:

 (top-gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 1       breakpoint     keep y                      internal_error
  1.1                        y   0x00000000005755a5 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54
 2       breakpoint     keep y                      -qualified internal_error
  2.1                        y   0x00000000005755a5 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54
 3       breakpoint     keep y                      errors.c:54
  3.1                        y   0x00000000005755a5 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54
  3.2                        y   0x00007ffff6d50410 in PyErr_SetObject at /usr/src/debug/python2-2.7.15-4.fc27.x86_64/Python/errors.c:54
 4       breakpoint     keep y                      gdb.c:27
  4.1                        y   0x000055555564107b in main(int, char**) at src/gdb/gdb.c:28
 (top-gdb)

i.e., always show the locations in their own rows, AND print the
canonical location spec in the "What" column of the breakpoint's
header row.  It also indents the location numbers by one space for
better grouping.  The need for grouping is clearer if you have
breakpoints with dozens of locations, such as when you do "b main"
when debugging GDB.

See that commit's log for a lot more details.

Patch #2 introduces an "info breakpoints -hide-locations" option.
With that, you get just the breakpoint header rows, showing the
canonical location spec originally used to set the breakpoint, but not
what the spec expanded to:

 (top-gdb) i b -h
 Num     Type           Disp Enb What
 1       breakpoint     keep y   internal_error
 2       breakpoint     keep y   -qualified internal_error
 3       breakpoint     keep y   errors.c:54

Before this can go in, I'll need to address testsuite fallout, of
course.  I expect this will be a significant effort, so I'm hoping we
can come to agreement on whether the GDB change is OK before wasting
time adjusting the testsuite.

Pedro Alves (2):
  Always show locations for breakpoints & show canonical location spec
  Introduce "info breakpoints -hide-locations"

 gdb/doc/gdb.texinfo       | 208 ++++++++++++++++++++--------------
 gdb/ada-lang.c            |   9 +-
 gdb/break-catch-exec.c    |  10 +-
 gdb/break-catch-fork.c    |  10 +-
 gdb/break-catch-load.c    |   8 +-
 gdb/break-catch-sig.c     |  10 +-
 gdb/break-catch-syscall.c |   9 +-
 gdb/break-catch-throw.c   |  10 +-
 gdb/breakpoint.c          | 228 +++++++++++++++++++++++++-------------
 gdb/breakpoint.h          |   5 +-
 gdb/cli/cli-option.c      |  12 +-
 gdb/cli/cli-option.h      |   6 +
 12 files changed, 324 insertions(+), 201 deletions(-)


base-commit: ee3272d472e864bcbe86d6c647d7b48df715c72b
-- 
2.36.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2023-04-10 15:07 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 21:55 [PATCH 0/2] info breakpoints improvements Pedro Alves
2022-05-19 21:55 ` [PATCH 1/2] Always show locations for breakpoints & show canonical location spec Pedro Alves
2022-05-20  6:45   ` Eli Zaretskii
2022-05-23 17:04     ` [PATCH v2 " Pedro Alves
2022-05-24 13:06       ` Eli Zaretskii
2022-05-25 19:32         ` Pedro Alves
2022-05-26 12:48           ` Eli Zaretskii
2022-05-26 14:04             ` Pedro Alves
2022-05-26 15:03               ` Eli Zaretskii
2022-05-26 15:10                 ` Pedro Alves
2022-05-26 15:33                   ` Eli Zaretskii
2022-05-26 19:29                 ` Pedro Alves
2022-05-26 19:55                   ` Eli Zaretskii
2022-05-26 20:40                     ` Pedro Alves
2023-04-10 15:07                   ` Andrew Burgess
2022-05-20  7:45   ` [PATCH " Metzger, Markus T
2022-05-23 17:05     ` Lancelot SIX
2022-05-19 21:55 ` [PATCH 2/2] Introduce "info breakpoints -hide-locations" Pedro Alves
2022-05-20  6:48   ` Eli Zaretskii
2022-05-20  5:57 ` [PATCH 0/2] info breakpoints improvements Eli Zaretskii
2022-05-23 17:06   ` Pedro Alves
2022-05-24 13:14     ` Eli Zaretskii
2022-05-24 13:45       ` Pedro Alves
2022-05-24  8:38 ` Luis Machado
2022-05-24 10:02   ` Pedro Alves
2022-05-24 13:20     ` Eli Zaretskii
2022-05-24 13:29       ` Pedro Alves
2022-05-24 13:43         ` Eli Zaretskii
2022-05-24 13:50           ` Pedro Alves
2022-05-24 14:03             ` Eli Zaretskii
2022-05-24 14:09               ` Pedro Alves
2022-05-24 14:25                 ` Eli Zaretskii
2022-05-24 14:33                   ` Pedro Alves
2022-05-24 14:11               ` Andreas Schwab
2022-05-24 14:17                 ` Pedro Alves
2022-05-24 19:49                   ` [PATCH] Show enabled locations with disabled breakpoint parent as "y-" (Re: [PATCH 0/2] info breakpoints improvements) Pedro Alves
2022-05-25 13:57                     ` Eli Zaretskii
2022-05-25 19:19                       ` Pedro Alves
2022-05-24 14:26                 ` [PATCH 0/2] info breakpoints improvements Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).