mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-21 09:16:17 +08:00
gdb: don't duplicate 'thread' field in MI breakpoint output
When creating a thread-specific breakpoint with a single location, the 'thread' field would be repeated in the MI output. This can be seen in two existing tests gdb.mi/mi-nsmoribund.exp and gdb.mi/mi-pending.exp, e.g.: (gdb) -break-insert -p 1 bar ^done,bkpt={number="1",type="breakpoint",disp="keep", enabled="y", addr="0x000000000040110a",func="bar", file="/tmp/mi-thread-specific-bp.c", fullname="/tmp/mi-thread-specific-bp.c", line="32",thread-groups=["i1"], thread="1",thread="1", <================ DUPLICATION! times="0",original-location="bar"} I know we need to be careful when adjusting MI output, but I'm hopeful in this case, as the field is duplicated, and the field contents are always identical, that we might get away with removing one of the duplicates. The change in GDB is a fairly trivial condition change. We did have a couple of tests that contained the duplicate fields in their expected output, but given there was no comment pointing out this oddity either in the GDB code, or in the test, I suspect this was more a case of copying whatever output GDB produced and using that as the expected results. I've updated these tests to remove the duplication. I've update lib/mi-support.exp to provide support for building breakpoint patterns that contain the thread field, and I've made use of this in a new test I've added that is just about creating thread-specific breakpoints and checking the results. The two tests I mentioned above as being updated could also use the new lib/mi-support.exp functionality, but I'm going to do that in a later patch, this way it is clear what changes I'm actually proposing to make to the expected output. As I said, I hope that frontends will be able to handle this change, but I still think its worth adding a NEWS entry, that way, if someone runs into problems, there's a chance they can figure out what's going on. This should not impact CLI output at all. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
@ -6480,7 +6480,7 @@ print_one_breakpoint_location (struct breakpoint *b,
|
||||
For the CLI output, the thread/task information is printed on a
|
||||
separate line, see the 'stop only in thread' and 'stop only in task'
|
||||
output below. */
|
||||
if (!header_of_multiple && uiout->is_mi_like_p ())
|
||||
if (part_of_multiple && uiout->is_mi_like_p ())
|
||||
{
|
||||
if (b->thread != -1)
|
||||
uiout->field_signed ("thread", b->thread);
|
||||
|
Reference in New Issue
Block a user