I want to use tracepoints to debug a prog on a local machine where i have full access. I am able to set the tracepoint and its passcount and using info tr gives me
(gdb) info tr
Num Enb Address PassC StepC What
1 y 0x080b7529 2 0 in search_tcp at tcp_pkt.c:412
Actions for tracepoint 1:
collect flow
end
Then i run the prog, it runs as usual and in the end when i give tfind or tdump to collect the required data it shows:
(gdb) tfind 1
Trace can only be run on remote targets.
(gdb) tdump
Trace can only be run on remote targets.
Even i tried using “tstart” but it shows again “Trace can only be run on remote targets.”
Any idea on what is the meaning of this message ? Is tracepoing usage not supported currently ? OR is it for debugging some remote machine over LAN or some other network ?
Any help would be greatly appreciated.
thanks
vikas
The meaning is exactly what the message says: the tracepoint facility is implemented only in
gdbserver, and not in GDB itself, so you can’t usetstartwhen debugging natively (when GDB controls the inferior (being debugged) process directly).Instead, you need to set up a remote debugging session (which can still be done on a single machine):
In another window:
Now you’ll have GDB with a remote target (which is the
gdbserverrunning on the same host), andtstartetc. will work.Update:
Before you can use
tstart, you need to set trace and actions, as documented here.And you can’t
runbecause the inferior process is already running. Usecontinueinstead.Update 2:
It sounds like your
gdbserveris old, and does in fact not support tracing.What do
produce?
Update 3:
Apparently your
gdbserveris too old.Even though GDB itself supported tracepoints since version 4.17,
gdbserveronly started supporting the tracepoints with version 7.2Update 4:
Simple. You can read the documentation for gdbserver, but I believe you are looking for this invocation: