def stackdepth(frame):
 depth = 0
 while frame:
  frame = frame.older()
  depth += 1
 return depth

def stackdepth ( frame ) : depth = 0 while frame : frame = frame . older ( ) depth += 1 return depth
tells the stackdepth of a gdb frame .