This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: automated trace output with gdb
- From: Michael Snyder <msnyder at vmware dot com>
- To: Edward Peschko <horos11 at gmail dot com>
- Cc: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Wed, 29 Oct 2008 10:11:26 -0700
- Subject: Re: automated trace output with gdb
- References: <5cfa99000810290001i7d042cf0lf8739bab23b70997@mail.gmail.com>
Edward Peschko wrote:
All,
Solaris' dbx had the ability to record runs of programs - ie: you
could say 'trace step' and you could then see - printed out - all the
lines of code execute as the debugger executed them..
Does gdb have something similar? I see the concept of tracepoints, but
that's not exactly what I had in mind.. I just want a running
commentary of the code as it runs, without having to press 'n' and/or
's' all the time.. Could this be implemented in terms of tracepoints?
First of all, I don't think tracepoints are related.
What you ask is not a built-in feature of gdb, but
I often do something like it by writing a short gdb
script. For a not-very-general example, I'll do
something like:
set $foo = 100
while $foo--
step
end
You could make $foo a parameter, or you could define some
more useful condition for stopping. You could also use
"while 1" if you wanted it to run forever.