public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simark@simark.ca>,  Kevin Buettner <kevinb@redhat.com>
Subject: Re: [PATCH 1/2] Fix PR 28308 - dprintf breakpoints not working when run from script
Date: Tue, 16 Nov 2021 13:18:20 -0700	[thread overview]
Message-ID: <87pmqzetwz.fsf@tromey.com> (raw)
In-Reply-To: <20211109203426.0656c9ea@f35-m3> (Kevin Buettner via Gdb-patches's message of "Tue, 9 Nov 2021 20:34:26 -0700")

>>>>> "Kevin" == Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org> writes:

Kevin> Another way of implementing it would have been to associate three
Kevin> commands with a dprintf breakpoint:

Kevin>   quiet
Kevin>   printf ...  / call (void) printf (...) / agent-print ...
Kevin>   continue

Kevin> This is basically what you'd use as a breakpoint command list if GDB
Kevin> didn't have the dprintf facility.  The virtue of this approach is that
Kevin> it could use the existing breakpoint w/ associated command logic
Kevin> without having to introduce some of the stuff that's only used by the
Kevin> dprintf mechanism.  This current bug either wouldn't have happened or,
Kevin> if it did, would have affected the rest of the breakpoint/command
Kevin> functionality as well.

Kevin> I think it's probable that this approach (that I'm suggesting) was
Kevin> considered but was found lacking in some way.  If so, I'd guess that
Kevin> either there's some major "gotcha" which I have considered or else
Kevin> it's too slow.

The problem with the above approach is that it interferes with other gdb
commands.  For example, if you step onto a dprintf spot, this may cause
gdb to resume the inferior rather than stop.  Or, if you 'next', and the
code hits a dprintf, the resulting 'continue' will cause gdb to forget
it is stepping.

Tom

  reply	other threads:[~2021-11-16 20:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02  1:00 [PATCH 0/2] " Kevin Buettner
2021-10-02  1:00 ` [PATCH 1/2] " Kevin Buettner
2021-11-05 16:05   ` Simon Marchi
2021-11-10  3:34     ` Kevin Buettner
2021-11-16 20:18       ` Tom Tromey [this message]
2021-11-18 18:34         ` Kevin Buettner
2021-10-02  1:00 ` [PATCH 2/2] Test case for Bug 28308 Kevin Buettner
2021-11-05 16:21   ` Simon Marchi
2021-11-10  1:44     ` Kevin Buettner
2021-11-18 22:46       ` Kevin Buettner
2021-10-19  9:30 ` [PATCH 0/2] Fix PR 28308 - dprintf breakpoints not working when run from script Kevin Buettner
2021-11-02 19:09 ` Kevin Buettner

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=87pmqzetwz.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=simark@simark.ca \
    /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).