Debugging agent library

Yao Qi
Tue May 7 07:33:00 GMT 2013


On 05/07/2013 03:21 AM, Suchakra Sharma wrote:
> Hi,
> We tried to find out how to use the debugging agent library here [1] but
> were unsuccessful. As of now, we have built a test app linked to dagent

It would be nice if you post some details about how you use dagent and 
the error message you got.

> which creates a socket file and expects commands. We wish to use it with
> GDB as well as other applications to primarily objective of tracing
> using GDB's fast tracepoint infra. Any help in this regard will be
> appreciated.
> [1]

I checked out the wiki and realize that the existing documentation has 
an assumption that readers are much familiar with GDB and GDB 
tracepoint.  The session below shows how to install fast tracepoint 
through dagent.

In one console, start the program in GDBserver,

$ LD_PRELOAD=/install/lib/ ./gdbserver/gdbserver :1234 

In the other console, start GDB and connect to GDBserver,

$ ./gdb ./testsuite/gdb.base/break
(gdb) target remote :1234
(gdb) b main
(gdb) c

(gdb) b marker4  // set breakpoint to make sure program doesn't exit
(gdb) ftrace *0x0804851e // set fast tracepoint at certain address
(gdb) set agent on   // enable agent
(gdb) tstart         // start tracing
(gdb) c
(gdb) tstop          // stop tracing
(gdb) tfind          // examine the trace frames tracepoint collects
Found trace frame 0, tracepoint 3
#0  main (argc=<unavailable>, argv=<unavailable>, envp=<unavailable>) at 
94          marker1 ();  /* set breakpoint 11 here */

Let me know if you get something else or obviously wrong.

Yao (齐尧)

More information about the Gdb mailing list