This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: automated trace output with gdb


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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]