Mercurial > cpython-lru_cache-weakref
diff Tools/gdb/libpython.py @ 60791:86d08cb6ba5c legacy-trunk
Issue #8437: Fix test_gdb failures, patch written by Dave Malcolm
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Tue, 20 Apr 2010 22:28:31 +0000 |
| parents | d7d5c76545fb |
| children | 5d6b76890f17 |
line wrap: on
line diff
--- a/Tools/gdb/libpython.py Tue Apr 20 21:09:06 2010 +0000 +++ b/Tools/gdb/libpython.py Tue Apr 20 22:28:31 2010 +0000 @@ -1148,18 +1148,17 @@ def is_evalframeex(self): '''Is this a PyEval_EvalFrameEx frame?''' - if self._gdbframe.function(): - if self._gdbframe.name() == 'PyEval_EvalFrameEx': - ''' - I believe we also need to filter on the inline - struct frame_id.inline_depth, only regarding frames with - an inline depth of 0 as actually being this function + if self._gdbframe.name() == 'PyEval_EvalFrameEx': + ''' + I believe we also need to filter on the inline + struct frame_id.inline_depth, only regarding frames with + an inline depth of 0 as actually being this function - So we reject those with type gdb.INLINE_FRAME - ''' - if self._gdbframe.type() == gdb.NORMAL_FRAME: - # We have a PyEval_EvalFrameEx frame: - return True + So we reject those with type gdb.INLINE_FRAME + ''' + if self._gdbframe.type() == gdb.NORMAL_FRAME: + # We have a PyEval_EvalFrameEx frame: + return True return False @@ -1309,8 +1308,6 @@ def invoke(self, args, from_tty): move_in_stack(move_up=True) -PyUp() - class PyDown(gdb.Command): 'Select and print the python stack frame called by this one (if any)' def __init__(self): @@ -1323,7 +1320,10 @@ def invoke(self, args, from_tty): move_in_stack(move_up=False) -PyDown() +# Not all builds of gdb have gdb.Frame.select +if hasattr(gdb.Frame, 'select'): + PyUp() + PyDown() class PyBacktrace(gdb.Command): 'Display the current python frame and all the frames within its call stack (if any)'
