summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-04-20 22:28:31 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-04-20 22:28:31 (GMT)
commita92e81bf48307b2b8ebbfc4d7ddcc55034514d92 (patch)
treed28c85bf197a00401bf30fb0d6a87924d34d172d /Tools
parente593fad81b0cc16c98c61ae0e162cff6dbca0f25 (diff)
downloadcpython-a92e81bf48307b2b8ebbfc4d7ddcc55034514d92.zip
cpython-a92e81bf48307b2b8ebbfc4d7ddcc55034514d92.tar.gz
cpython-a92e81bf48307b2b8ebbfc4d7ddcc55034514d92.tar.bz2
Issue #8437: Fix test_gdb failures, patch written by Dave Malcolm
Diffstat (limited to 'Tools')
-rw-r--r--Tools/gdb/libpython.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 7726020..f62735f 100644
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -1148,18 +1148,17 @@ class Frame(object):
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
-
- So we reject those with type gdb.INLINE_FRAME
- '''
- if self._gdbframe.type() == gdb.NORMAL_FRAME:
- # We have a PyEval_EvalFrameEx frame:
- return True
+ 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
return False
@@ -1309,8 +1308,6 @@ class PyUp(gdb.Command):
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 @@ class PyDown(gdb.Command):
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)'