Re: [PATCH v2] gdb: Modify the output of "info breakpoints" and "delete breakpoints"

Tiezhu Yang
2024-02-18T02:08:02Z

On 05/19/2022 09:08 PM, Bruno Larsen wrote:
>
> On 5/19/22 06:16, Tiezhu Yang wrote:
>> The output of "info breakpoints" includes breakpoint, watchpoint,
>> tracepoint and catchpoint, after delete all breakpoints, it should
>> show tracepoint and catchpoint in the output of "info breakpoints"
>> to report empty list.
>>
>> It should also change the output of "delete breakpoints" to make it
>> clear that watchpoints, tracepoints and catchpoints are also being
>> deleted. This is suggested by Bruno Larsen, thank you.
>>
>> $ make check-gdb TESTS="gdb.base/access-mem-running.exp"
>> $ gdb/gdb
>> gdb/testsuite/outputs/gdb.base/access-mem-running/access-mem-running
>> [...]
>> (gdb) break main
>> Breakpoint 1 at 0x12000073c: file
>> /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c,
>> line 32.
>> (gdb) watch global_counter
>> Hardware watchpoint 2: global_counter
>> (gdb) trace maybe_stop_here
>> Tracepoint 3 at 0x12000071c: file
>> /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c,
>> line 27.
>> (gdb) catch fork
>> Catchpoint 4 (fork)
>> (gdb) info breakpoints
>> Num Type Disp Enb Address What
>> 1 breakpoint keep y 0x000000012000073c in main at
>> /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c:32
>> 2 hw watchpoint keep y global_counter
>> 3 tracepoint keep y 0x000000012000071c in maybe_stop_here
>> at /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c:27
>> not installed on target
>> 4 catchpoint keep y fork
>>
>> Without this patch:
>>
>> (gdb) delete breakpoints
>> Delete all breakpoints? (y or n) y
>> (gdb) info breakpoints
>> No breakpoints or watchpoints.
>> (gdb) info breakpoints 3
>> No breakpoint or watchpoint matching '3'.
>>
>> With this patch:
>>
>> (gdb) delete breakpoints
>> Delete all breakpoints, watchpoints, tracepoints and catchpoints? (y
>> or n) y
>> (gdb) info breakpoints
>> No breakpoints, watchpoints, tracepoints or catchpoints.
>> (gdb) info breakpoints 3
>> No breakpoint, watchpoint, tracepoint or catchpoint matching '3'.
>>
>
> Hey Tiezhu,
>
> Thanks for this change, I'm fine with this patch. However, I can't
> approve patches to be pushed. Let's hope a maintainer shows up soon :-)

Hi,

Is it necessary to rebase and update this patch?
Should I drop it or send a new version?

Thanks,
Tiezhu