aboutsummaryrefslogtreecommitdiff
path: root/gdb/NEWS
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2020-05-23 22:27:28 +0200
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2022-11-19 13:38:38 +0100
commit78805ff8aecf0a8c828fb1e2c344fa3a56655120 (patch)
treecd4f81d81ae3f1c78f360e21d5e933a8ceb19745 /gdb/NEWS
parent15253318be0995200cc59929ca32eedbfd041e45 (diff)
downloadfsf-binutils-gdb-78805ff8aecf0a8c828fb1e2c344fa3a56655120.zip
fsf-binutils-gdb-78805ff8aecf0a8c828fb1e2c344fa3a56655120.tar.gz
fsf-binutils-gdb-78805ff8aecf0a8c828fb1e2c344fa3a56655120.tar.bz2
Show locno for 'multi location' breakpoint hit msg+conv var $_hit_bbnum $_hit_locno PR breakpoints/12464
This implements the request given in PR breakpoints/12464. Before this patch, when a breakpoint that has multiple locations is reached, GDB printed: Thread 1 "zeoes" hit Breakpoint 1, some_func () at somefunc1.c:5 This patch changes the message so that bkpt_print_id prints the precise encountered breakpoint: Thread 1 "zeoes" hit Breakpoint 1.2, some_func () at somefunc1.c:5 In mi mode, bkpt_print_id also (optionally) prints a new table field "locno": locno is printed when the breakpoint hit has more than one location. Note that according to the GDB user manual node 'GDB/MI Development and Front Ends', it is ok to add new fields without changing the MI version. Also, when a breakpoint is reached, the convenience variables $_hit_bpnum and $_hit_locno are set to the encountered breakpoint number and location number. $_hit_bpnum and $_hit_locno can a.o. be used in the command list of a breakpoint, to disable the specific encountered breakpoint, e.g. disable $_hit_bpnum.$_hit_locno In case the breakpoint has only one location, $_hit_locno is set to the value 1, so as to allow a command such as: disable $_hit_bpnum.$_hit_locno to disable the breakpoint even when the breakpoint has only one location. This also fixes a strange behaviour: when a breakpoint X has only one location, enable|disable X.1 is accepted but transforms the breakpoint in a multiple locations breakpoint having only one location. The changes in RFA v4 handle the comments of Tom Tromey: - Changed convenience var names from $bkptno/$locno to $_hit_bpnum/$_hit_locno. - updated the tests and user manual accordingly. User manual also explictly describes that $_hit_locno is set to 1 for a breakpoint with a single location. - The variable values are now set in bpstat_do_actions_1 so that they are set for silent breakpoints, and when several breakpoints are hit at the same time, that the variables are set to the printed breakpoint. The changes in RFA v3 handle the additional comments of Eli: GDB/NEW: - Use max 80-column - Use 'code location' instead of 'location'. - Fix typo $bkpno - Ensure that disable $bkptno and disable $bkptno.$locno have each their explanation inthe example - Reworded the 'breakpoint-hit' paragraph. gdb.texinfo: - Use 'code location' instead of 'location'. - Add a note to clarify the distinction between $bkptno and $bpnum. - Use @kbd instead of examples with only one command. Compared to RFA v1, the changes in v2 handle the comments given by Keith Seitz and Eli Zaretskii: - Use %s for the result of paddress - Use bkptno_numopt_re instead of 2 different -re cases - use C@t{++} - Add index entries for $bkptno and $locno - Added an example for "locno" in the mi interface - Added examples in the Break command manual.
Diffstat (limited to 'gdb/NEWS')
-rw-r--r--gdb/NEWS26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index 424e5ff..dddef65 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -81,6 +81,26 @@
* New convenience variable $_inferior_thread_count contains the number
of live threads in the current inferior.
+* When a breakpoint with multiple code locations is hit, GDB now prints
+ the code location using the syntax <breakpoint_number>.<location_number>
+ such as in:
+ Thread 1 "zeoes" hit Breakpoint 2.3, some_func () at zeoes.c:8
+
+* When a breakpoint is hit, GDB now sets the convenience variables $_hit_bpnum
+ and $_hit_locno to the hit breakpoint number and code location number.
+ This allows to disable the last hit breakpoint using
+ (gdb) disable $_hit_bpnum
+ or disable only the specific breakpoint code location using
+ (gdb) disable $_hit_bpnum.$_hit_locno
+ These commands can be used inside the command list of a breakpoint to
+ automatically disable the just encountered breakpoint (or the just
+ encountered specific breakpoint code location).
+ When a breakpoint has only one location, $_hit_locno is set to 1 so that
+ (gdb) disable $_hit_bpnum.$_hit_locno
+ and
+ (gdb) disable $_hit_bpnum
+ are both disabling the breakpoint.
+
* New commands
maintenance set ignore-prologue-end-flag on|off
@@ -152,6 +172,12 @@ GNU/Linux/LoongArch (gdbserver) loongarch*-*-linux*
GNU/Linux/CSKY (gdbserver) csky*-*linux*
+* MI changes
+
+ ** The async record stating the stopped reason 'breakpoint-hit' now
+ contains an optional field locno giving the code location number
+ when the breakpoint has multiple code locations.
+
* Python API
** GDB will now reformat the doc string for gdb.Command and