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 /Python/ceval_macros.h | |
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 'Python/ceval_macros.h')
-rw-r--r-- | Python/ceval_macros.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index 6f6fabc..1130b10 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -138,13 +138,13 @@ GETITEM(PyObject *v, Py_ssize_t i) { /* Code access macros */ /* The integer overflow is checked by an assertion below. */ -#define INSTR_OFFSET() ((int)(next_instr - _PyCode_CODE(frame->f_code))) +#define INSTR_OFFSET() ((int)(next_instr - _PyCode_CODE(_PyFrame_GetCode(frame)))) #define NEXTOPARG() do { \ _Py_CODEUNIT word = *next_instr; \ opcode = word.op.code; \ oparg = word.op.arg; \ } while (0) -#define JUMPTO(x) (next_instr = _PyCode_CODE(frame->f_code) + (x)) +#define JUMPTO(x) (next_instr = _PyCode_CODE(_PyFrame_GetCode(frame)) + (x)) #define JUMPBY(x) (next_instr += (x)) /* OpCode prediction macros @@ -182,7 +182,7 @@ GETITEM(PyObject *v, Py_ssize_t i) { /* The stack can grow at most MAXINT deep, as co_nlocals and co_stacksize are ints. */ #define STACK_LEVEL() ((int)(stack_pointer - _PyFrame_Stackbase(frame))) -#define STACK_SIZE() (frame->f_code->co_stacksize) +#define STACK_SIZE() (_PyFrame_GetCode(frame)->co_stacksize) #define EMPTY() (STACK_LEVEL() == 0) #define TOP() (stack_pointer[-1]) #define SECOND() (stack_pointer[-2]) @@ -221,8 +221,8 @@ GETITEM(PyObject *v, Py_ssize_t i) { /* Data access macros */ -#define FRAME_CO_CONSTS (frame->f_code->co_consts) -#define FRAME_CO_NAMES (frame->f_code->co_names) +#define FRAME_CO_CONSTS (_PyFrame_GetCode(frame)->co_consts) +#define FRAME_CO_NAMES (_PyFrame_GetCode(frame)->co_names) /* Local variable macros */ @@ -270,6 +270,8 @@ GETITEM(PyObject *v, Py_ssize_t i) { #define GLOBALS() frame->f_globals #define BUILTINS() frame->f_builtins #define LOCALS() frame->f_locals +#define CONSTS() _PyFrame_GetCode(frame)->co_consts +#define NAMES() _PyFrame_GetCode(frame)->co_names #define DTRACE_FUNCTION_ENTRY() \ if (PyDTrace_FUNCTION_ENTRY_ENABLED()) { \ |