@@ -21,9 +21,65 @@ extern PyTypeObject _PyExc_MemoryError;
21
21
/* The static initializers defined here should only be used
22
22
in the runtime init code (in pystate.c and pylifecycle.c). */
23
23
24
-
25
24
#define _PyRuntimeState_INIT(runtime) \
26
25
{ \
26
+ .debug_offsets = { \
27
+ .cookie = "xdebugpy", \
28
+ .version = PY_VERSION_HEX, \
29
+ .runtime_state = { \
30
+ .finalizing = offsetof(_PyRuntimeState, _finalizing), \
31
+ .interpreters_head = offsetof(_PyRuntimeState, interpreters.head), \
32
+ }, \
33
+ .interpreter_state = { \
34
+ .next = offsetof(PyInterpreterState, next), \
35
+ .threads_head = offsetof(PyInterpreterState, threads.head), \
36
+ .gc = offsetof(PyInterpreterState, gc), \
37
+ .imports_modules = offsetof(PyInterpreterState, imports.modules), \
38
+ .sysdict = offsetof(PyInterpreterState, sysdict), \
39
+ .builtins = offsetof(PyInterpreterState, builtins), \
40
+ .ceval_gil = offsetof(PyInterpreterState, ceval.gil), \
41
+ .gil_runtime_state_locked = offsetof(PyInterpreterState, _gil.locked), \
42
+ .gil_runtime_state_holder = offsetof(PyInterpreterState, _gil.last_holder), \
43
+ }, \
44
+ .thread_state = { \
45
+ .prev = offsetof(PyThreadState, prev), \
46
+ .next = offsetof(PyThreadState, next), \
47
+ .interp = offsetof(PyThreadState, interp), \
48
+ .cframe = offsetof(PyThreadState, cframe), \
49
+ .thread_id = offsetof(PyThreadState, thread_id), \
50
+ .native_thread_id = offsetof(PyThreadState, native_thread_id), \
51
+ }, \
52
+ .interpreter_frame = { \
53
+ .previous = offsetof(_PyInterpreterFrame, previous), \
54
+ .executable = offsetof(_PyInterpreterFrame, f_executable), \
55
+ .prev_instr = offsetof(_PyInterpreterFrame, prev_instr), \
56
+ .localsplus = offsetof(_PyInterpreterFrame, localsplus), \
57
+ .owner = offsetof(_PyInterpreterFrame, owner), \
58
+ }, \
59
+ .cframe = { \
60
+ .current_frame = offsetof(_PyCFrame, current_frame), \
61
+ .previous = offsetof(_PyCFrame, previous), \
62
+ }, \
63
+ .code_object = { \
64
+ .filename = offsetof(PyCodeObject, co_filename), \
65
+ .name = offsetof(PyCodeObject, co_name), \
66
+ .linetable = offsetof(PyCodeObject, co_linetable), \
67
+ .firstlineno = offsetof(PyCodeObject, co_firstlineno), \
68
+ .argcount = offsetof(PyCodeObject, co_argcount), \
69
+ .localsplusnames = offsetof(PyCodeObject, co_localsplusnames), \
70
+ .localspluskinds = offsetof(PyCodeObject, co_localspluskinds), \
71
+ .co_code_adaptive = offsetof(PyCodeObject, co_code_adaptive), \
72
+ }, \
73
+ .pyobject = { \
74
+ .ob_type = offsetof(PyObject, ob_type), \
75
+ }, \
76
+ .type_object = { \
77
+ .tp_name = offsetof(PyTypeObject, tp_name), \
78
+ }, \
79
+ .tuple_object = { \
80
+ .ob_item = offsetof(PyTupleObject, ob_item), \
81
+ }, \
82
+ }, \
27
83
.allocators = { \
28
84
.standard = _pymem_allocators_standard_INIT(runtime), \
29
85
.debug = _pymem_allocators_debug_INIT, \
0 commit comments