[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
10.1.4 Tracepoint Action Lists
-
actions [num]
This command will prompt for a list of actions to be taken when the tracepoint is hit. If the tracepoint number num is not specified, this command sets the actions for the one that was most recently defined (so that you can define a tracepoint and then say
actions
without bothering about its number). You specify the actions themselves on the following lines, one action at a time, and terminate the actions list with a line containing justend
. So far, the only defined actions arecollect
andwhile-stepping
.To remove all actions from a tracepoint, type ‘actions num’ and follow it immediately with ‘end’.
(No value for GDBP) collect data // collect some data (No value for GDBP) while-stepping 5 // single-step 5 times, collect data (No value for GDBP) end // signals the end of actions.
In the following example, the action list begins with
collect
commands indicating the things to be collected when the tracepoint is hit. Then, in order to single-step and collect additional data following the tracepoint, awhile-stepping
command is used, followed by the list of things to be collected while stepping. Thewhile-stepping
command is terminated by its own separateend
command. Lastly, the action list is terminated by anend
command.(No value for GDBP) trace foo (No value for GDBP) actions Enter actions for tracepoint 1, one per line: > collect bar,baz > collect $regs > while-stepping 12 > collect $fp, $sp > end end
-
collect expr1, expr2, …
Collect values of the given expressions when the tracepoint is hit. This command accepts a comma-separated list of any valid expressions. In addition to global, static, or local variables, the following special arguments are supported:
-
$regs
collect all registers
-
$args
collect all function arguments
-
$locals
collect all local variables.
You can give several consecutive
collect
commands, each one with a single argument, or onecollect
command with several arguments separated by commas: the effect is the same.The command
info scope
(see section info scope) is particularly useful for figuring out what data to collect.-
-
while-stepping n
Perform n single-step traces after the tracepoint, collecting new data at each step. The
while-stepping
command is followed by the list of what to collect while stepping (followed by its ownend
command):> while-stepping 12 > collect $regs, myglobal > end >
You may abbreviate
while-stepping
asws
orstepping
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |