diff options
author | Hui Li <lihui@loongson.cn> | 2024-07-30 19:41:05 +0800 |
---|---|---|
committer | Tiezhu Yang <yangtiezhu@loongson.cn> | 2024-08-01 22:23:44 +0800 |
commit | 94223333026f06dc5d78266dd9b6082544641f07 (patch) | |
tree | 1934231759f07f3ae600ddbcafc2d20e51238c2a /binutils/windint.h | |
parent | 479c61163612f37d853efd21c40963459ef611d4 (diff) | |
download | binutils-94223333026f06dc5d78266dd9b6082544641f07.zip binutils-94223333026f06dc5d78266dd9b6082544641f07.tar.gz binutils-94223333026f06dc5d78266dd9b6082544641f07.tar.bz2 |
gdb: LoongArch: Add show-debug-regs maintenance command
This patch register the command "maint set show-debug-regs on/off"
and make it settable by the user. If show-debug-regs is enabled,
the debug register values are shown when GDB inserts or removes a
hardware breakpoint or watchpoint. This is helpful for the use and
development of hardware watchpoints.
With this patch, the effect of this maintenance command as follows:
lihui@bogon:~$ cat test.c
int a = 0;
int main()
{
a = 1;
return 0;
}
lihui@bogon:~$ gcc -g test.c -o test
lihui@bogon:~$ gdb test
...
(gdb) watch a
Hardware watchpoint 1: a
(gdb) maint set show-debug-regs on
(gdb) r
Starting program: /home/lihui/test
...
...
prepare_to_resume thread 41525
...
insert_watchpoint (addr=0x12000803c, len=4, type=hw-write-watchpoint):
BREAKPOINTs:
BP0: addr=0x0, ctrl=0x00000000, ref.count=0
BP1: addr=0x0, ctrl=0x00000000, ref.count=0
BP2: addr=0x0, ctrl=0x00000000, ref.count=0
BP3: addr=0x0, ctrl=0x00000000, ref.count=0
BP4: addr=0x0, ctrl=0x00000000, ref.count=0
BP5: addr=0x0, ctrl=0x00000000, ref.count=0
BP6: addr=0x0, ctrl=0x00000000, ref.count=0
BP7: addr=0x0, ctrl=0x00000000, ref.count=0
WATCHPOINTs:
WP0: addr=0x0, ctrl=0x00000000, ref.count=0
WP1: addr=0x0, ctrl=0x00000000, ref.count=0
WP2: addr=0x0, ctrl=0x00000000, ref.count=0
WP3: addr=0x0, ctrl=0x00000000, ref.count=0
WP4: addr=0x0, ctrl=0x00000000, ref.count=0
WP5: addr=0x0, ctrl=0x00000000, ref.count=0
WP6: addr=0x0, ctrl=0x00000000, ref.count=0
WP7: addr=0x12000803c, ctrl=0x00000610, ref.count=1
...
remove_watchpoint (addr=0x12000803c, len=4, type=hw-write-watchpoint):
BREAKPOINTs:
BP0: addr=0x0, ctrl=0x00000000, ref.count=0
BP1: addr=0x0, ctrl=0x00000000, ref.count=0
BP2: addr=0x0, ctrl=0x00000000, ref.count=0
BP3: addr=0x0, ctrl=0x00000000, ref.count=0
BP4: addr=0x0, ctrl=0x00000000, ref.count=0
BP5: addr=0x0, ctrl=0x00000000, ref.count=0
BP6: addr=0x0, ctrl=0x00000000, ref.count=0
BP7: addr=0x0, ctrl=0x00000000, ref.count=0
WATCHPOINTs:
WP0: addr=0x0, ctrl=0x00000000, ref.count=0
WP1: addr=0x0, ctrl=0x00000000, ref.count=0
WP2: addr=0x0, ctrl=0x00000000, ref.count=0
WP3: addr=0x0, ctrl=0x00000000, ref.count=0
WP4: addr=0x0, ctrl=0x00000000, ref.count=0
WP5: addr=0x0, ctrl=0x00000000, ref.count=0
WP6: addr=0x0, ctrl=0x00000000, ref.count=0
WP7: addr=0x0, ctrl=0x00000000, ref.count=0
Hardware watchpoint 1: a
Old value = 0
New value = 1
main () at test.c:5
5 return 0;
(gdb)
Signed-off-by: Hui Li <lihui@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'binutils/windint.h')
0 files changed, 0 insertions, 0 deletions