In some situations, the target running a trace experiment may no
longer be available; perhaps it crashed, or the hardware was needed
for a different activity. To handle these cases, you can arrange to
dump the trace data into a file, and later use that file as a source
of trace data, via the target tfile
command.
tsave [ -r ]
filenametsave [-ctf]
dirname-r
(“remote”) to direct the target to save
the data directly into filename in its own filesystem, which may be
more efficient if the trace buffer is very large. (Note, however, that
target tfile
can only read from files accessible to the host.)
By default, this command will save trace frame in tfile format.
You can supply the optional argument -ctf
to save data in CTF
format. The Common Trace Format (CTF) is proposed as a trace format
that can be shared by multiple debugging and tracing tools. Please go to
<http://www.efficios.com/ctf
> to get more information.
target tfile
filenametarget ctf
dirnametstatus
will report the state of the trace run at the moment
the data was saved, as well as the current trace frame you are examining.
Both filename and dirname must be on a filesystem accessible to
the host.
(gdb) target ctf ctf.ctf (gdb) tfind Found trace frame 0, tracepoint 2 39 ++a; /* set tracepoint 1 here */ (gdb) tdump Data collected at tracepoint 2, trace frame 0: i = 0 a = 0 b = 1 '\001' c = {"123", "456", "789", "123", "456", "789"} d = {{{a = 1, b = 2}, {a = 3, b = 4}}, {{a = 5, b = 6}, {a = 7, b = 8}}} (gdb) p b $1 = 1