Skip to content

Commit 1f6c663

Browse files
pablogsallkollar
authored andcommitted
pythongh-115999: Add PyCodeObject.co_tlbc to the debug offsets (python#134286)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
1 parent 1d6ffeb commit 1f6c663

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

@@ -110,6 +114,7 @@ typedef struct _Py_DebugOffsets {
110114
uint64_t localsplus;
111115
uint64_t owner;
112116
uint64_t stackpointer;
117+
uint64_t tlbc_index;
113118
} interpreter_frame;
114119

115120
// Code object offset;
@@ -124,6 +129,7 @@ typedef struct _Py_DebugOffsets {
124129
uint64_t localsplusnames;
125130
uint64_t localspluskinds;
126131
uint64_t co_code_adaptive;
132+
uint64_t co_tlbc;
127133
} code_object;
128134

129135
// PyObject offset;
@@ -272,6 +278,7 @@ typedef struct _Py_DebugOffsets {
272278
.localsplus = offsetof(_PyInterpreterFrame, localsplus), \
273279
.owner = offsetof(_PyInterpreterFrame, owner), \
274280
.stackpointer = offsetof(_PyInterpreterFrame, stackpointer), \
281+
.tlbc_index = _Py_Debug_interpreter_frame_tlbc_index, \
275282
}, \
276283
.code_object = { \
277284
.size = sizeof(PyCodeObject), \
@@ -284,6 +291,7 @@ typedef struct _Py_DebugOffsets {
284291
.localsplusnames = offsetof(PyCodeObject, co_localsplusnames), \
285292
.localspluskinds = offsetof(PyCodeObject, co_localspluskinds), \
286293
.co_code_adaptive = offsetof(PyCodeObject, co_code_adaptive), \
294+
.co_tlbc = _Py_Debug_code_object_co_tlbc, \
287295
}, \
288296
.pyobject = { \
289297
.size = sizeof(PyObject), \

0 commit comments

Comments
 (0)