Unix Programming - can gdb support record of execution of function?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2007 > can gdb support record of execution of function?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author can gdb support record of execution of function?
Bin Chen

2007-10-18, 1:30 am

Hi,

Can gdb record the executed function names, but not only backtrace?
Such as:

main()
{
a();
b();
c();

breakpoint.
}

Then when it stops on breakpoint, I can issue a command to print it
has executed from a() to c(), which can't be got by backtrace.

Thanks.
Bin

Paul Pluzhnikov

2007-10-18, 1:30 am

Bin Chen <binary.chen@gmail.com> writes:

> Can gdb record the executed function names, but not only backtrace?


No (at least not yet).

> main()
> {
> a();
> b();
> c();
>
> breakpoint.
> }
>
> Then when it stops on breakpoint, I can issue a command to print it
> has executed from a() to c(), which can't be got by backtrace.


Usually this is done by using various logging techniques.

There is also a concept of "reverse debugging", which would allow
you to go back and see that c() was called, and go back further to
see that b() was also called, etc.

There is even a debugger that implements it: http://undo-software.com/

There is also talk of adding such functionality to gdb:
http://sourceware.org/gdb/news/reversible.html
but it's not there yet.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com