Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Stackless issue #275: Support PEP-523 eval_frame-hook #276

Merged
merged 12 commits into from
Aug 8, 2021

Conversation

akruis
Copy link

@akruis akruis commented Jun 22, 2021

Stackless issue #275: Support PEP-523 eval_frame-hook

Support the PEP-523 eval_frame-hook for one particular use case: byte
code instrumentation. An example is the pydev-debugger. It can use the
hook to inject "break-points". This is much more efficient, than
traditional trace functions.

Tested with eclipse pydev 8.3.0.202104101217 and with the current 'main' branch of https://github.com/fabioz/PyDev.Debugger. It works, and does not crash, but it does not modify byte code, because Stackless main-slp does not yet support PEP-570.
Support for PEP-570 comes between v3.8.0a3 and v3.8.0a4 with commit 8c77b8c. Therefore we should delay this pull request until after merging 8c77b8c. We need additional commits, at least bdace21.

Anselm Kruis added 6 commits June 20, 2021 23:15
Integrate the C-function PyEval_EvalFrameEx_slp into into the C-function
slp_eval_frame_value and rename slp_eval_frame_value to
PyEval_EvalFrameEx_slp.

Adapt the gdb support library and document the change.
Support the PEP-523 eval_frame-hook for one particular use case: byte
code instrumentation. An example is the pydev-debugger. It can use the
hook to inject "break-points". This is much more efficient, than
traditional trace functions.
Support the PEP-523 eval_frame-hook for one particular use case: byte
code instrumentation. An example is the pydev-debugger. It can use the
hook to inject "break-points". This is much more efficient, than
traditional trace functions.

Improve the implementation and add a test case.
@akruis akruis marked this pull request as ready for review July 16, 2021 17:59
@akruis akruis changed the base branch from main-slp to 3.8-slp August 8, 2021 06:10
@akruis
Copy link
Author

akruis commented Aug 8, 2021

Now that upstream commit bdace21 has been merged (commit 05f4c34 in branch 3.8-slp) Stackless 3.8 is ABI compatible with Cython for C-Python 3.8. Therefore I could test the latest PyDev Debugger and it works well. I used gdb to verify that the eval_frame_hook is indeed used as expected.

Time to merge the pull request and to port it to main-slp.

@akruis akruis merged commit 34108b9 into stackless-dev:3.8-slp Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant