[RFC] syntax change for "record save"

Jakob Engblom jakob@virtutech.com
Wed Dec 2 17:46:00 GMT 2009

> 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

Gdb> concat $n "foo" $a
Gdb> save $n


Best regards,



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 

More information about the Gdb mailing list