Next: GDB/MI Symbol Query, Previous: GDB/MI Data Manipulation, Up: GDB/MI
The commands defined in this section implement MI support for tracepoints. For detailed introduction, see Tracepoints.
-trace-find
Command-trace-find mode [parameters...]
Find a trace frame using criteria defined by mode and parameters. The following table lists permissible modes and their parameters. For details of operation, see tfind.
If ‘none’ was passed as mode, the response does not have fields. Otherwise, the response may have the following fields:
The corresponding gdb command is ‘tfind’.
-trace-define-variable name [ value ]
Create trace variable name if it does not exist. If value is specified, sets the initial value of the specified trace variable to that value. Note that the name should start with the ‘$’ character.
The corresponding gdb command is ‘tvariable’.
-trace-frame-collected
Command-trace-frame-collected [--var-print-values var_pval] [--comp-print-values comp_pval] [--registers-format regformat] [--memory-contents]
This command returns the set of collected objects, register names, trace state variable names, memory ranges and computed expressions that have been collected at a particular trace frame. The optional parameters to the command affect the output format in different ways. See the output description table below for more details.
The reported names can be used in the normal manner to create varobjs and inspect the objects themselves. The items returned by this command are categorized so that it is clear which is a variable, which is a register, which is a trace state variable, which is a memory range and which is a computed expression.
For instance, if the actions were
collect myVar, myArray[myIndex], myObj.field, myPtr->field, myCount + 2 collect *(int*)0xaf02bef0@40
the object collected in its entirety would be myVar
. The
object myArray
would be partially collected, because only the
element at index myIndex
would be collected. The remaining
objects would be computed expressions.
An example output would be:
(gdb) -trace-frame-collected ^done, explicit-variables=[{name="myVar",value="1"}], computed-expressions=[{name="myArray[myIndex]",value="0"}, {name="myObj.field",value="0"}, {name="myPtr->field",value="1"}, {name="myCount + 2",value="3"}, {name="$tvar1 + 1",value="43970027"}], registers=[{number="0",value="0x7fe2c6e79ec8"}, {number="1",value="0x0"}, {number="2",value="0x4"}, ... {number="125",value="0x0"}], tvars=[{name="$tvar1",current="43970026"}], memory=[{address="0x0000000000602264",length="4"}, {address="0x0000000000615bc0",length="4"}] (gdb)
Where:
explicit-variables
--var-print-values
option affects how or whether the value
field is output. If var_pval is 0, then print only the names;
if it is 1, print also their values; and if it is 2, print the name,
type and value for simple data types, and the name and type for
arrays, structures and unions.
computed-expressions
--comp-print-values
option affects
this set like the --var-print-values
option affects the
explicit-variables
set. See above.
registers
--registers-format
option. See the -data-list-register-values command for a
list of the allowed formats. The default is ‘x’.
tvars
memory
address
length
contents
--memory-contents
option is specified.
There is no corresponding gdb command.
-trace-list-variables
Return a table of all defined trace variables. Each element of the table has the following fields:
The corresponding gdb command is ‘tvariables’.
(gdb) -trace-list-variables ^done,trace-variables={nr_rows="1",nr_cols="3", hdr=[{width="15",alignment="-1",col_name="name",colhdr="Name"}, {width="11",alignment="-1",col_name="initial",colhdr="Initial"}, {width="11",alignment="-1",col_name="current",colhdr="Current"}], body=[variable={name="$trace_timestamp",initial="0"} variable={name="$foo",initial="10",current="15"}]} (gdb)
-trace-save [-r ] filename
Saves the collected trace data to filename. Without the ‘-r’ option, the data is downloaded from the target and saved in a local file. With the ‘-r’ option the target is asked to perform the save.
The corresponding gdb command is ‘tsave’.
-trace-start
Starts a tracing experiments. The result of this command does not have any fields.
The corresponding gdb command is ‘tstart’.
-trace-status
Obtains the status of a tracing experiment. The result may include the following fields:
-trace-stop
command. The value of ‘overflow’ means
the tracing buffer is full. The value of ‘disconnection’ means
tracing was automatically stopped when gdb has disconnected.
The value of ‘passcount’ means tracing was stopped when a
tracepoint was passed a maximal number of times for that tracepoint.
This field is present if ‘supported’ field is not ‘0’.
1
means that the
trace buffer is circular and old trace frames will be discarded if
necessary to make room, 0
means that the trace buffer is linear
and may fill up.
1
means that
tracing will continue after gdb disconnects, 0
means
that the trace run will stop.
The corresponding gdb command is ‘tstatus’.
-trace-stop
Stops a tracing experiment. The result of this command has the same
fields as -trace-status
, except that the ‘supported’ and
‘running’ fields are not output.
The corresponding gdb command is ‘tstop’.