public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Simon Marchi <simark@simark.ca>
Subject: Re: [PATCH 1/2] Fix PR 28308 - dprintf breakpoints not working when run from script
Date: Thu, 18 Nov 2021 11:34:52 -0700	[thread overview]
Message-ID: <20211118113452.5d26de4f@f35-m3> (raw)
In-Reply-To: <87pmqzetwz.fsf@tromey.com>

On Tue, 16 Nov 2021 13:18:20 -0700
Tom Tromey <tom@tromey.com> wrote:

> >>>>> "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.

I see.  Thanks for the explanation.

Kevin


  reply	other threads:[~2021-11-18 18:34 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
2021-11-18 18:34         ` Kevin Buettner [this message]
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=20211118113452.5d26de4f@f35-m3 \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.com \
    /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).