This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: [RFC] syntax change for "record save"
- From: "Jakob Engblom" <jakob at virtutech dot com>
- To: <tromey at redhat 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: Wed, 2 Dec 2009 18:46:33 +0100
- Subject: RE: [RFC] syntax change for "record save"
- References: <4B0EF39A.10802@vmware.com> <20091127013738.GL18141@adacore.com> <00b601ca7285$a3ff39f0$ebfdadd0$@com> <m3pr6yo5f4.fsf@fleche.redhat.com>
> 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.
I see. I had believed that the gdb command-line was more general than that.
Sorry for my lack of insight. That's why I did not say "we should do this", just
asking if this would work.
> 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.
On the other hand, in a script, can't you do this in two steps?
Add a command to build strings into variables, and then use that variable in teh
command?
Gdb> concat $n "foo" $a
Gdb> save $n
?
Best regards,
/jakob
_______________________________________________________
Jakob Engblom, PhD, Technical Marketing Manager
Virtutech?????????????????? Direct: +46 8 690 07 47???
Drottningholmsvägen 22????? Mobile: +46 709 242 646??
11243 Stockholm???????????? Web:??? www.virtutech.com?
Sweden
________________________________________________________
?