
On Fri, Apr 22, 2022 at 2:52 PM Fabio Zadrozny <fabiofz@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.