From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] Alternate approach to keeping convenience variables
Date: Tue, 24 Jan 2006 19:24:00 -0000 [thread overview]
Message-ID: <20060124192438.GA24103@nevyn.them.org> (raw)
In-Reply-To: <8f2776cb0601241116l3338806mc334d157e5553481@mail.gmail.com>
On Tue, Jan 24, 2006 at 11:16:38AM -0800, Jim Blandy wrote:
> On 1/24/06, Daniel Jacobowitz <drow@false.org> wrote:
> > > Right, but there's no way to test for that in the scripting language.
> > > Your 'init-if-undefined' command has to be a primitive, implemented in
> > > C. My argument was that having the variables always be present is
> > > more convenient for user-defined commands.
> >
> > Andrew's point is that such a primitive was recently committed :-)
>
> If you want your user-defined command to print a helpful error mesage,
> you can't use that in an 'if'. If we had some operator like
> $defined($foo), then that'd be different.
At this point we've gotten pretty far afield from the original
question. How does defined($foo) help relative to having the variables
always present?
To refresh, here's what an unpatched GDB without a symbol file shows:
(gdb) show convenience
$trace_frame = -1
$tpnum = 0
With a symbol file:
(gdb) show convenience
No debugger convenience variables now defined.
Convenience variables have names starting with "$";
use "set" as in "set $foo = 5" to define them.
With a tracepoint:
(gdb) show convenience
$tpnum = 1
And, presumably, $trace_frame is set when you're actually using
tracepoints (which I can't test).
I think that the "without symbol file" output should be replaced by the
"with symbol file" output. I don't think it likely that there are
any existing scripts that this would break. If there were, they could
add "init-if-undefined $tpnum = 0" and "init-if-undefined $trace_frame
= -1", and be back where they started from.
For those not using tracepoints, or huge .gdbinit scripts which know
about tracepoints, it's nice to hide the tracepoint variables. Can you
think of any example that would break? Since GDB is normally used
with a symbol file, it seems unlikely.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-01-24 19:24 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-21 22:05 [PATCH] keeping convenience variables (take 2) Andrew STUBBS
2005-11-22 4:58 ` Eli Zaretskii
2005-11-22 8:43 ` Jim Blandy
2005-11-22 19:27 ` Andrew STUBBS
2005-12-10 4:46 ` [RFC] Alternate approach to keeping convenience variables Daniel Jacobowitz
2005-12-10 5:07 ` Jim Blandy
2005-12-10 8:24 ` Daniel Jacobowitz
2005-12-10 22:20 ` Jim Blandy
2005-12-11 18:12 ` Eli Zaretskii
2005-12-11 19:17 ` Eli Zaretskii
2006-01-23 22:29 ` Jim Blandy
2006-01-24 11:44 ` Andrew STUBBS
2006-01-24 18:41 ` Jim Blandy
2006-01-24 18:43 ` Daniel Jacobowitz
2006-01-24 19:16 ` Jim Blandy
2006-01-24 19:24 ` Daniel Jacobowitz [this message]
2006-01-25 0:13 ` Jim Blandy
2006-01-24 19:45 ` Andrew STUBBS
2006-01-04 12:17 ` Andrew STUBBS
2006-01-04 17:00 ` Jim Blandy
2006-01-04 17:48 ` Andrew STUBBS
2006-01-04 18:37 ` Jim Blandy
2006-01-22 21:04 ` Daniel Jacobowitz
2006-01-22 21:31 ` Daniel Jacobowitz
2006-01-23 22:46 ` Jim Blandy
2006-01-27 17:53 ` Eli Zaretskii
2006-01-27 18:12 ` Jim Blandy
2006-01-27 18:29 ` Eli Zaretskii
2006-01-27 18:41 ` Joel Brobecker
2006-02-01 23:14 ` Daniel Jacobowitz
2006-02-02 4:18 ` Eli Zaretskii
2006-02-06 22:14 ` Daniel Jacobowitz
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=20060124192438.GA24103@nevyn.them.org \
--to=drow@false.org \
--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