gdb, breakpoint: add breakpoint location debugging logs
authorMihails Strasuns <mihails.strasuns@intel.com>
Tue, 3 Dec 2019 12:13:25 +0000 (13:13 +0100)
committerSchimpe, Christina <christina.schimpe@intel.com>
Wed, 9 Aug 2023 07:38:57 +0000 (07:38 +0000)
commit3cdc2d7e66ab6a48014dcd425c88cfd42a964321
tree6cb88b43fd596f95df195bb0071aa116759656ab
parent7d523a910bde9e7c119f3e078c081f94e6fe412b
gdb, breakpoint: add breakpoint location debugging logs

Add new commands:

  set debug breakpoint on|off
  show debug breakpoint

This patch introduces new debugging information that prints
breakpoint location insertion and removal flow.

The debug output looks like:
~~~
(gdb) set debug breakpoint on
(gdb) disassemble main
Dump of assembler code for function main:
   0x0000555555555129 <+0>: endbr64
   0x000055555555512d <+4>: push   %rbp
   0x000055555555512e <+5>: mov    %rsp,%rbp
=> 0x0000555555555131 <+8>: mov    $0x0,%eax
   0x0000555555555136 <+13>: pop    %rbp
   0x0000555555555137 <+14>: ret
End of assembler dump.
(gdb) break *0x0000555555555137
Breakpoint 2 at 0x555555555137: file main.c, line 4.
[breakpoint] update_global_location_list: insert_mode = UGLL_MAY_INSERT
(gdb) c
Continuing.
[breakpoint] update_global_location_list: insert_mode = UGLL_INSERT
[breakpoint] insert_bp_location: Breakpoint 2 (0x5565daddb1e0) at address 0x555555555137 in main at main.c:4
[breakpoint] insert_bp_location: Breakpoint -2 (0x5565dab51c10) at address 0x7ffff7fd37b5
[breakpoint] insert_bp_location: Breakpoint -5 (0x5565dab68f30) at address 0x7ffff7fe509e
[breakpoint] insert_bp_location: Breakpoint -7 (0x5565dab694f0) at address 0x7ffff7fe63f4
[breakpoint] remove_breakpoint_1: Breakpoint 2 (0x5565daddb1e0) at address 0x555555555137 in main at main.c:4 due to regular remove
[breakpoint] remove_breakpoint_1: Breakpoint -2 (0x5565dab51c10) at address 0x7ffff7fd37b5 due to regular remove
[breakpoint] remove_breakpoint_1: Breakpoint -5 (0x5565dab68f30) at address 0x7ffff7fe509e due to regular remove
[breakpoint] remove_breakpoint_1: Breakpoint -7 (0x5565dab694f0) at address 0x7ffff7fe63f4 due to regular remove

Breakpoint 2, 0x0000555555555137 in main () at main.c:4
4 }
~~~

Co-Authored-By: Christina Schimpe <christina.schimpe@intel.com>
gdb/NEWS
gdb/breakpoint.c
gdb/breakpoint.h
gdb/doc/gdb.texinfo