From: Marc Khouzam <marc.khouzam@ericsson.com>
To: "'Stan Shebs'" <stanshebs@earthlink.net>,
"'Andreas Schwab'" <schwab@linux-m68k.org>
Cc: "'gdb-patches@sourceware.org'" <gdb-patches@sourceware.org>
Subject: RE: [PATCH] dynamic printf
Date: Wed, 14 Mar 2012 14:47:00 -0000 [thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC5790B2996A@EUSAACMS0703.eamcs.ericsson.se> (raw)
In-Reply-To: <4F5FD3A6.1090106@earthlink.net>
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Stan Shebs
> Sent: Tuesday, March 13, 2012 7:09 PM
> To: Andreas Schwab
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH] dynamic printf
>
> On 2/29/12 1:14 AM, Andreas Schwab wrote:
> > Stan Shebs<stanshebs@earthlink.net> writes:
> >
> >> This patch implements a "dynamic printf", which is
> basically a breakpoint
> >> with a printf;continue as its command list - but with
> additional features
> >> that make it more interesting.
> > How about:
> >
> > break [LOCATION] [thread THREADNUM] [if CONDITION] [printf
> FORMAT,ARGS...]
When I tried it a while back, using a breakpoint + printf printed
to the GDB console. The new dprintf has the goal of printing to the
inferior's console.
With dprintf, the resulting printouts should look exactly the
same as if the user had added the printf in the code + recompiled.
Another way to achieve this may be to have a new
'inferior-printf' command similar to GDB's 'printf'
then
break [LOCATION] [thread THREADNUM] [if CONDITION] [inferior-printf FORMAT,ARGS...]
would work too, I think.
However, one would loose the disconnected printing aspect of
the feature, which also makes it much closer to actually adding
a real printf in the code.
> I've been wondering whether that might be a better idea. An
> advantage
> of "dprintf" for the command line is that it can abbreviate
> to just "dp"
> and tab completion works, while the optional arguments to the break
> command don't have any way to abbreviate (although they probably
> could). That's not super-compelling, as by its nature a
> printf command
> entails typing in format string, double quotes and newlines
> and all, and
> in practice I expect a lot of these will tend to accumulate
> in script files.
>
> Another consideration is how the collection looks in an info break
> command. If dynamic prints are a different kind of
> breakpoint, then you
> can (in theory) filter the breakpoint listing to a single
> category, but
> if they are just breakpoints with special commands, they'll
> continue to
> be in the big list.
>
> My intuition isn't giving me a strong read on which approach
> users will
> like better. As the goal is at least partly to entice
> printf()+recompile users into using a GDB command instead, I think it
> needs to be among GDB's simpler commands. Maybe include both
> syntaxes,
> mapping down to same functionality?
I think those points are good.
I personally don't have a strong opinion on those, since
I'm looking at it from the point of view of using this feature
from Eclipse.
BTW, I think this is one cool feature!
Marc
next prev parent reply other threads:[~2012-03-14 14:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 9:14 Stan Shebs
2012-02-29 10:28 ` Andreas Schwab
2012-03-13 23:09 ` Stan Shebs
2012-03-14 14:47 ` Marc Khouzam [this message]
2012-03-14 15:28 ` Tom Tromey
2012-02-29 16:16 ` Joel Brobecker
2012-03-13 23:15 ` Stan Shebs
2012-03-13 23:40 ` Joel Brobecker
2012-02-29 18:21 ` Eli Zaretskii
2012-03-13 23:20 ` Stan Shebs
2012-03-01 14:04 ` Hui Zhu
2012-03-04 6:31 ` Hui Zhu
2012-03-08 21:08 ` Tom Tromey
2012-03-13 23:51 ` Stan Shebs
2012-03-14 15:24 ` Tom Tromey
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=F7CE05678329534C957159168FA70DEC5790B2996A@EUSAACMS0703.eamcs.ericsson.se \
--to=marc.khouzam@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=schwab@linux-m68k.org \
--cc=stanshebs@earthlink.net \
/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