Starting And Stopping Trace Experiment; Using The Collected Data; Tfind N - Red Hat ENTERPRISE LINUX 3 - DEBUGGING WITH GDB Manual

Debugging with gdb
Hide thumbs Also See for ENTERPRISE LINUX 3 - DEBUGGING WITH GDB:
Table of Contents

Advertisement

Chapter 12. Tracepoints

12.1.6. Starting and Stopping Trace Experiment

tstart
This command takes no arguments. It starts the trace experiment, and begins collecting data. This
has the side effect of discarding all the data collected in the trace buffer during the previous trace
experiment.
tstop
This command takes no arguments. It ends the trace experiment, and stops collecting data.
Note: a trace experiment and data collection may stop automatically if any tracepoint's passcount
is reached (refer to Section 12.1.3 Tracepoint Passcounts), or if the trace buffer becomes full.
tstatus
This command displays the status of the current trace data collection.
Here is an example of the commands we described so far:
(gdb) trace gdb_c_test
(gdb) actions
Enter actions for tracepoint #1, one per line.
collect $regs,$locals,$args
while-stepping 11
collect $regs
end
end
(gdb) tstart
[time passes ...]
(gdb) tstop

12.2. Using the collected data

After the tracepoint experiment ends, you use gdb commands for examining the trace data. The basic
idea is that each tracepoint collects a trace snapshot every time it is hit and another snapshot every
time it single-steps. All these snapshots are consecutively numbered from zero and go into a buffer,
and you can examine them later. The way you examine them is to focus on a specific trace snapshot.
When the remote stub is focused on a trace snapshot, it will respond to all gdb requests for memory
and registers by reading from the buffer which belongs to that snapshot, rather than from real mem-
ory or registers of the program being debugged. This means that all gdb commands (
,
registers
backtrace
was when the tracepoint occurred. Any requests for data that are not in the buffer will fail.
12.2.1.
tfind
n
The basic command for selecting a trace snapshot from the buffer is
snapshot number
, counting from zero. If no argument
n
Here are the various forms of using the
, etc.) will behave as if we were currently debugging the program state as it
tfind
is given, the next snapshot is selected.
n
command.
print
, which finds trace
tfind
n
97
,
info

Advertisement

Table of Contents
loading

Table of Contents