This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] syntax change for "record save"
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: gdb at sourceware dot org, Hui Zhu <teawater at gmail dot com>
- Date: Thu, 26 Nov 2009 17:37:38 -0800
- Subject: Re: [RFC] syntax change for "record save"
- References: <4B0EF39A.10802@vmware.com>
> This proposal follows from Teawater's thread
> "A question about gdb script", in which Teawater
> wants to know how to use a gdb local variable
> to append a sequence number to the file name
> of a record log file.
This is not an objection, but I am really not fond of that extension.
It feels ad hoc that the extension, if provided, should be evaluated
as an integer. What if the user wanted a more general scheme? Or what
if he wanted to the suffix to be in hex?
If I were Teawater, I'd probably look at writing a python script
rather than a GDB script. In particular, it's easy to compose the
right CLI command from python using:
(gdb) python gdb.execute("rec save file.%d" % 1)
You can replace the "1" above by an python variable, including
one obtained by evaluating an expression as a long.
One thing that you might want to look at, to make things even easier,
is providing a Python interface to the record layer... Combine that
with the work done on getting inferior "events" (I can't remember
exactly the name of that project - I think it was a GSOC), and it
should be possible to script really nice things...
--
Joel