tags:

views:

26

answers:

1

Dear all!

Is it possible to find out the stack size (= number of frames in the stack) in a gdb script and use it 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.

A: 

You can do all of this with GDB 7.2, which exposes stack frames to its embedded Python interpreter.

Employed Russian