summaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2018-05-05 20:27:11 +0200
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2018-07-12 22:50:36 +0200
commit6a70eb7d9bf1646e7a7379eb8efdba30c2cb9c92 (patch)
treee61fb49238950e7f8488ca74ed9b20394a4c971b /gdb/thread.c
parent529c08b25ec7b9ba2a0b94083a08ec8d1a6e5528 (diff)
downloadbinutils-gdb-6a70eb7d9bf1646e7a7379eb8efdba30c2cb9c92.tar.gz
Implement frame apply [all | COUNT | -COUNT | level LEVEL... ] [FLAG]... COMMAND.
Implement frame apply [all | COUNT | -COUNT | level LEVEL... ] [FLAG]... COMMAND. Also implement the command 'faas COMMAND', a shortcut for 'frame apply all -s COMMAND'. The syntax of 'frame apply' to specify some innermost or outermost frames is similar to 'backtrace' command, using COUNT or -COUNT. To apply a COMMAND to a more specific set of frames, the following new command and syntax can be used: frame apply level LEVEL... [FLAG]... COMMAND where LEVEL is one or more frame levels or range of frame levels. The new command 'frame apply' allows to apply a COMMAND to a number of frames, or to all frames, or to a set of frames. The optional [FLAG]... arguments allow to control what output to produce and how to handle errors raised when applying COMMAND to a frame. Some example usages for this new command: frame apply all info frame Produce info frame for all frames. frame apply all p $sp For each frame, print the location, followed by the frame sp. frame apply all -q p $sp Same as before, but -q flag (q = quiet) indicates to only print the frames sp. frame apply all p some_local_var_somewhere Print some_local_var_somewhere in all frames. 'frame apply' will abort as soon as the print command fails. frame apply all -c p some_local_var_somewhere Same as before, but -c flag (c = continue) means to print the error and continue applying command in case the print command fails. frame apply all -s p some_local_var_somewhere Same as before, but -s flag (s = silent) means to be silent for frames where the print command fails. In other words, this allows to 'search' the frame in which some_local_var_somewhere can be printed. frame apply all -s -q p some_local_var_somewhere Same as before, but does not print the frame info in which the variable is found. frame apply level 2-4 5 8-10 -s p i = i + 1 Increments i in the identified frames. gdb/ChangeLog 2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be> * stack.c: (trailing_outermost_frame): New function, mostly extracted from backtrace_command_1. (leading_innermost_frame): New function. (backtrace_command_1): Update to call trailing_outermost_frame. (frame_apply_command_count): New function. (frame_apply_level_command): New function. (frame_apply_all_command): New function. (frame_apply_command): New function. (faas_command): New function. (frame_cmd_list): New variable. (_initialize_stack): Update to setup the new commands 'frame apply' and 'faas'.
Diffstat (limited to 'gdb/thread.c')
0 files changed, 0 insertions, 0 deletions