From: Michael Snyder <msnyder@vmware.com>
To: gdb@sourceware.org, Hui Zhu <teawater@gmail.com>
Subject: [RFC] syntax change for "record save"
Date: Fri, 27 Nov 2009 02:25:00 -0000 [thread overview]
Message-ID: <4B0EF39A.10802@vmware.com> (raw)
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.
Here is my proposal.
We change the syntax of the "record save" command
so that it expects an additional, optional argument.
If the 2nd argument is present, we evaluate it as an
integer expression and suffix it to the filename (with
a period). Evaluating it as an expression means that
it can be anything from an integer to a dollar-variable,
and the expression can even increment it.
So, for instance:
(gdb) rec save
Saved core file gdb_record.19165 with execution log.
(gdb) rec save foo 1
Saved core file foo.1 with execution log.
(gdb) rec save foo 2
Saved core file foo.2 with execution log.
(gdb) set $a = 1
(gdb) rec save foo $a++
Saved core file foo.1 with execution log.
(gdb) step
foo ()
at
/data/home/msnyder/cvs/localhost/quilt/gdb/testsuite/gdb.reverse/break-reverse.c:28
28 xyz = 1; /* break in foo */
(gdb) rec save foo $a++
Saved core file foo.2 with execution log.
(gdb) step
29 return bar ();
(gdb) rec save foo $a++
Saved core file foo.3 with execution log.
I'll submit a patch momentarily.
next reply other threads:[~2009-11-26 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 2:25 Michael Snyder [this message]
2009-11-27 7:55 ` Joel Brobecker
2009-11-27 15:17 ` Hui Zhu
2009-11-30 12:37 ` Michael Snyder
2009-12-01 12:56 ` Jakob Engblom
2009-12-01 19:35 ` Tom Tromey
2009-12-02 17:46 ` Jakob Engblom
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=4B0EF39A.10802@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb@sourceware.org \
--cc=teawater@gmail.com \
/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