Skip to content

Commit dd7f113

Browse files
authored
gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (#134286)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
1 parent 6dcb0fd commit dd7f113

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Include/internal/pycore_debug_offsets.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ extern "C" {
5252
#ifdef Py_GIL_DISABLED
5353
# define _Py_Debug_gilruntimestate_enabled offsetof(struct _gil_runtime_state, enabled)
5454
# define _Py_Debug_Free_Threaded 1
55+
# define _Py_Debug_code_object_co_tlbc offsetof(PyCodeObject, co_tlbc)
56+
# define _Py_Debug_interpreter_frame_tlbc_index offsetof(_PyInterpreterFrame, tlbc_index)
5557
#else
5658
# define _Py_Debug_gilruntimestate_enabled 0
5759
# define _Py_Debug_Free_Threaded 0
60+
# define _Py_Debug_code_object_co_tlbc 0
61+
# define _Py_Debug_interpreter_frame_tlbc_index 0
5862
#endif
5963

6064

@@ -109,6 +113,7 @@ typedef struct _Py_DebugOffsets {
109113
uint64_t localsplus;
110114
uint64_t owner;
111115
uint64_t stackpointer;
116+
uint64_t tlbc_index;
112117
} interpreter_frame;
113118

114119
// Code object offset;
@@ -123,6 +128,7 @@ typedef struct _Py_DebugOffsets {
123128
uint64_t localsplusnames;
124129
uint64_t localspluskinds;
125130
uint64_t co_code_adaptive;
131+
uint64_t co_tlbc;
126132
} code_object;
127133

128134
// PyObject offset;
@@ -265,6 +271,7 @@ typedef struct _Py_DebugOffsets {
265271
.localsplus = offsetof(_PyInterpreterFrame, localsplus), \
266272
.owner = offsetof(_PyInterpreterFrame, owner), \
267273
.stackpointer = offsetof(_PyInterpreterFrame, stackpointer), \
274+
.tlbc_index = _Py_Debug_interpreter_frame_tlbc_index, \
268275
}, \
269276
.code_object = { \
270277
.size = sizeof(PyCodeObject), \
@@ -277,6 +284,7 @@ typedef struct _Py_DebugOffsets {
277284
.localsplusnames = offsetof(PyCodeObject, co_localsplusnames), \
278285
.localspluskinds = offsetof(PyCodeObject, co_localspluskinds), \
279286
.co_code_adaptive = offsetof(PyCodeObject, co_code_adaptive), \
287+
.co_tlbc = _Py_Debug_code_object_co_tlbc, \
280288
}, \
281289
.pyobject = { \
282290
.size = sizeof(PyObject), \

0 commit comments

Comments
 (0)