title: gdb determine stack size, conditional in command list
body: <p>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")</p>
  
  <p>And is it possible to have conditions within command lists? I'm looking for something like this (in pseudo code):</p>
  
  <pre><code>break initialize.cc:41
  commands
  if stack.size()&gt;4: bt 1
  end
  </code></pre>
  
  <p>Thank you and kind regards, Bernd.</p>