diff options
author | Mark Shannon <mark@hotpy.org> | 2023-06-14 12:46:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-14 12:46:37 (GMT) |
commit | 7199584ac8632eab57612f595a7162ab8d2ebbc0 (patch) | |
tree | eda3183876d2ce6805796d5c8f7b0cd8abadc22e /Objects/genobject.c | |
parent | ad56340b665c5d8ac1f318964f71697bba41acb7 (diff) | |
download | cpython-7199584ac8632eab57612f595a7162ab8d2ebbc0.zip cpython-7199584ac8632eab57612f595a7162ab8d2ebbc0.tar.gz cpython-7199584ac8632eab57612f595a7162ab8d2ebbc0.tar.bz2 |
GH-100987: Allow objects other than code objects as the "executable" of an internal frame. (GH-105727)
* Add table describing possible executable classes for out-of-process debuggers.
* Remove shim code object creation code as it is no longer needed.
* Make lltrace a bit more robust w.r.t. non-standard frames.
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r-- | Objects/genobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 5c93ef4..6f0f02c 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -29,7 +29,7 @@ static const char *ASYNC_GEN_IGNORED_EXIT_MSG = static inline PyCodeObject * _PyGen_GetCode(PyGenObject *gen) { _PyInterpreterFrame *frame = (_PyInterpreterFrame *)(gen->gi_iframe); - return frame->f_code; + return _PyFrame_GetCode(frame); } PyCodeObject * @@ -957,7 +957,7 @@ static PyObject * gen_new_with_qualname(PyTypeObject *type, PyFrameObject *f, PyObject *name, PyObject *qualname) { - PyCodeObject *code = f->f_frame->f_code; + PyCodeObject *code = _PyFrame_GetCode(f->f_frame); int size = code->co_nlocalsplus + code->co_stacksize; PyGenObject *gen = PyObject_GC_NewVar(PyGenObject, type, size); if (gen == NULL) { @@ -1339,7 +1339,7 @@ compute_cr_origin(int origin_depth, _PyInterpreterFrame *current_frame) } frame = current_frame; for (int i = 0; i < frame_count; ++i) { - PyCodeObject *code = frame->f_code; + PyCodeObject *code = _PyFrame_GetCode(frame); int line = PyUnstable_InterpreterFrame_GetLine(frame); PyObject *frameinfo = Py_BuildValue("OiO", code->co_filename, line, code->co_name); |