public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/8] gdb: don't duplicate 'thread' field in MI breakpoint output
Date: Mon, 20 Feb 2023 16:47:41 +0200	[thread overview]
Message-ID: <838rgsv1f6.fsf@gnu.org> (raw)
In-Reply-To: <a57a4ba43d67cd995b212d16c3f6c472c0319bbf.1676901929.git.aburgess@redhat.com> (message from Andrew Burgess via Gdb-patches on Mon, 20 Feb 2023 14:13:47 +0000)

> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Mon, 20 Feb 2023 14:13:47 +0000
> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
> 
> 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 was 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.
> ---
>  gdb/NEWS                                      |  8 +++
>  gdb/breakpoint.c                              |  2 +-
>  gdb/testsuite/gdb.mi/mi-nsmoribund.exp        |  2 +-
>  gdb/testsuite/gdb.mi/mi-pending.exp           |  2 +-
>  gdb/testsuite/gdb.mi/mi-thread-specific-bp.c  | 44 +++++++++++++++++
>  .../gdb.mi/mi-thread-specific-bp.exp          | 49 +++++++++++++++++++
>  gdb/testsuite/lib/mi-support.exp              | 32 ++++++++----
>  7 files changed, 127 insertions(+), 12 deletions(-)
>  create mode 100644 gdb/testsuite/gdb.mi/mi-thread-specific-bp.c
>  create mode 100644 gdb/testsuite/gdb.mi/mi-thread-specific-bp.exp

Thanks, the NEWS part is OK.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>

  reply	other threads:[~2023-02-20 14:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 14:13 [PATCH 0/8] Fix missing MI =breakpoint-deleted notifications Andrew Burgess
2023-02-20 14:13 ` [PATCH 1/8] gdb: remove an out of date comment about disp_del_at_next_stop Andrew Burgess
2023-02-20 14:13 ` [PATCH 2/8] gdb: don't duplicate 'thread' field in MI breakpoint output Andrew Burgess
2023-02-20 14:47   ` Eli Zaretskii [this message]
2023-02-22 15:18   ` Pedro Alves
2023-02-20 14:13 ` [PATCH 3/8] gdb/testsuite: make more use of mi-support.exp Andrew Burgess
2023-02-20 14:13 ` [PATCH 4/8] gdb/testsuite: extend the use of mi_clean_restart Andrew Burgess
2023-02-20 14:13 ` [PATCH 5/8] gdb/testsuite introduce foreach_mi_ui_mode helper proc Andrew Burgess
2023-02-22 15:18   ` Pedro Alves
2023-02-20 14:13 ` [PATCH 6/8] gdb/testsuite: introduce is_target_non_stop " Andrew Burgess
2023-02-22 15:19   ` Pedro Alves
2023-02-27 14:58     ` Andrew Burgess
2023-02-27 16:18       ` Pedro Alves
2023-02-20 14:13 ` [PATCH 7/8] gdb/testsuite: fix failure in gdb.mi/mi-pending.exp with extended-remote Andrew Burgess
2023-02-22 15:19   ` Pedro Alves
2023-02-20 14:13 ` [PATCH 8/8] gdb: fix mi breakpoint-deleted notifications for thread-specific b/p Andrew Burgess
2023-02-22 15:20   ` Pedro Alves
2023-02-22 15:23 ` [PATCH 0/8] Fix missing MI =breakpoint-deleted notifications Pedro Alves
2023-02-28 11:09   ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838rgsv1f6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).