Skip to content

Commit

Permalink
merge 3.4-slp (Stackless python#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselm Kruis committed Nov 22, 2016
2 parents 2c6c6a6 + 9246084 commit 299fd98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 15 additions & 1 deletion Tools/gdb/libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 299fd98

Please sign in to comment.