diff --git a/Stackless/changelog.txt b/Stackless/changelog.txt index cbd5982e11bb2e..fac9775cefef05 100644 --- a/Stackless/changelog.txt +++ b/Stackless/changelog.txt @@ -9,8 +9,13 @@ What's New in Stackless 3.X.X? *Release date: 20XX-XX-XX* +- https://bitbucket.org/stackless-dev/stackless/issues/101 + Enhance Tools/gdb/libpython.py to support debugging Stackless Python. + You can now debug Stackless Python with gdb. Unfortunately gdb still + does not know about inactive tasklets and their frames. + - https://bitbucket.org/stackless-dev/stackless/issues/99 - On UNIX like systems you can use the command + On UNIX like systems you can use the command $ make teststackless to run the Stackless unit tests. Previously the command required some non POSIX commands. diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 2ad22e2bbe80fa..8ea4648224fb11 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -86,6 +86,10 @@ ENCODING = locale.getpreferredencoding() +# name of the evalframeex function. It CPython and Stackless Python +# use different names +EVALFRAMEEX_FUNCTION_NAME = None + class NullPyObjectPtr(RuntimeError): pass @@ -1426,7 +1430,17 @@ def is_python_frame(self): def is_evalframeex(self): '''Is this a PyEval_EvalFrameEx frame?''' - if self._gdbframe.name() == 'PyEval_EvalFrameEx': + global EVALFRAMEEX_FUNCTION_NAME + if EVALFRAMEEX_FUNCTION_NAME is None: + try: + gdb.lookup_type("PyCFrameObject") + # it is Stackless Python + EVALFRAMEEX_FUNCTION_NAME = 'PyEval_EvalFrame_value' + except gdb.error: + # regular CPython + EVALFRAMEEX_FUNCTION_NAME = 'PyEval_EvalFrameEx' + + if self._gdbframe.name() == EVALFRAMEEX_FUNCTION_NAME: ''' I believe we also need to filter on the inline struct frame_id.inline_depth, only regarding frames with