gdb determine stack size, conditional in command list
Is it possible to find out the stack size (= number of frames in the stack) in a gdb script and use it开发者_JS百科 as a condition in a command list? (By gdb script I mean a list of commands that can be given to gdb as "gdb --command='gdb_script' executable")
And is it possible to have conditions within command lists? I'm looking for something like this (in pseudo code):
break initialize.cc:41
commands
if stack.size()>4: bt 1
end
Thank you and kind regards, Bernd.
You can do all of this with GDB 7.2, which exposes stack frames to its embedded Python interpreter.
精彩评论