This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] syntax change for "record save"
- From: Tom Tromey <tromey at redhat dot com>
- To: "Jakob Engblom" <jakob at virtutech dot com>
- Cc: "'Joel Brobecker'" <brobecker at adacore dot com>, "'Michael Snyder'" <msnyder at vmware dot com>, <gdb at sourceware dot org>, "'Hui Zhu'" <teawater at gmail dot com>
- Date: Tue, 01 Dec 2009 12:33:35 -0700
- Subject: Re: [RFC] syntax change for "record save"
- References: <4B0EF39A.10802@vmware.com> <20091127013738.GL18141@adacore.com> <00b601ca7285$a3ff39f0$ebfdadd0$@com>
- Reply-to: tromey at redhat dot com
>>>>> "Jakob" == Jakob Engblom <jakob@virtutech.com> writes:
Jakob> So we would do something like this:
simics> save ("file." + $a)
Jakob> (when the first argument to + is a string, the next argument is
Jakob> forced to a string)
Jakob> I think supporting string generation would solve many more
Jakob> problems easily.
The problem is that it is not obvious how to integrate this into the
existing gdb CLI. The CLI is not like a normal programming language,
with a regular syntax and a parser. Any regularity is just by
convention; each command is just passed a char* that it parses itself.
Of course, we could invent something. We could even turn the CLI into a
much more expressive language. I'd rather not, though -- we have Python
for that, and I think it is generally better to just reuse an existing
language than to try to invent a new one.
Jakob> The save name INDEX to me seems silly, if you are doing this
Jakob> manually, why don't you just type a different name each time?
Yeah, presumably this is only done via scripting. That's why I think it
is ok if the spelling of the commands is a bit verbose.
Tom