[PATCH] gdb: breakpoint: Add "tracepoint" when report empty list

Tiezhu Yang yangtiezhu@loongson.cn
Thu May 19 08:40:04 GMT 2022



On 05/18/2022 09:23 PM, Bruno Larsen wrote:
> On 5/14/22 05:09, Tiezhu Yang wrote:
>> The output of "info breakpoints" includes breakpoint, watchpoint and
>> tracepoint, after delete all breakpoints, it should show "tracepoint"
>> in the output of "info breakpoints" to report empty list.
>>
>> $ 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) 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
>> (gdb) delete breakpoints
>> Delete all breakpoints? (y or n) y
>>
>> Without this patch:
>>
>> (gdb) info breakpoints
>> No breakpoints or watchpoints.
>> (gdb) info breakpoints 3
>> No breakpoint or watchpoint matching '3'.
>>
>> With this patch:
>>
>> (gdb) info breakpoints
>> No breakpoints, watchpoints or tracepoints.
>> (gdb) info breakpoints 3
>> No breakpoint, watchpoint or tracepoint matching '3'.
>> Hello Tiezhu,
>
> I think this is a good idea, but I think this patch should also change
> the "delete all breakpoints" message to make it clear that watchpoints
> and tracepoints are also being deleted.
>
> Other than that, no regressions were found for either gcc or clang, so
> with the change to the delete message, I'd say this patch is fine. I
> can't actually approve it for pushing, though.
>
> Cheers!
> Bruno Larsen


Hi Bruno,

Thank you very much for your review and suggestion.

It seems that the output of "info breakpoints" and "delete breakpoints"
should include breakpoint, watchpoint, tracepoint and catchpoint.

I will modify the related code and then send v2 later.

Thanks,
Tiezhu



More information about the Gdb-patches mailing list