On Fri, Apr 22, 2022 at 2:52 PM Fabio Zadrozny <fabi...@gmail.com> wrote:
> Humm, now I'm a bit worried... the approach the debugger is using gets the 
> PyFrameObject that's about to be executed and changes the 
> PyFrameObject.f_code just before the execution so that the new code is 
> executed instead.

You can already modify _PyInterpreterFrame.f_code using the internal C API.

> From what you're saying the PyFrameObject isn't really used anymore 
> (apparently it's substituted by a _PyInterpreterFrame?)... in this case, will 
> this approach still let the debugger patch the code object in the frame 
> before it's actually executed?

There is no public C API to modify the "f_code" attribute of a
PyFrameObject. There is only PyFrame_GetCode() *getter*.

Victor
-- 
Night gathers, and now my watch begins. It shall not end until my death.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RTBUDAEPTZBTAHEO5LV77MHEH7URJP3J/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to