actionswithout 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 just
end. So far, the only defined actions are
while-stepping. To remove all actions from a tracepoint, type `actions num' and follow it immediately with `end'.
(gdb) collect data // collect some data (gdb) while-stepping 5 // single-step 5 times, collect data (gdb) end // signals the end of actions.In the following example, the action list begins with
collectcommands indicating the things to be collected when the tracepoint is hit. Then, in order to single-step and collect additional data following the tracepoint, a
while-steppingcommand is used, followed by the list of things to be collected while stepping. The
while-steppingcommand is terminated by its own separate
endcommand. Lastly, the action list is terminated by an
(gdb) trace foo (gdb) 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, ...
collectcommands, each one with a single argument, or one
collectcommand with several arguments separated by commas: the effect is the same. The command
info scope(see section Examining the Symbol Table) is particularly useful for figuring out what data to collect.
while-steppingcommand is followed by the list of what to collect while stepping (followed by its own
> while-stepping 12 > collect $regs, myglobal > end >You may abbreviate
Go to the first, previous, next, last section, table of contents.