Skip to content

Commit 5942474

Browse files
godlygeekpablogsal
authored andcommitted
Update debug offsets for 3.13rc2
Note that after this change, we're no longer able to decode stacks for earlier versions of Python 3.13. Signed-off-by: Matt Wozniski <[email protected]>
1 parent 4653a98 commit 5942474

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

src/pystack/_pystack/cpython/runtime.h

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ typedef struct _Py_DebugOffsets
254254
{
255255
char cookie[8];
256256
uint64_t version;
257+
uint64_t free_threaded;
257258
// Runtime state offset;
258259
struct _runtime_state
259260
{
@@ -274,6 +275,8 @@ typedef struct _Py_DebugOffsets
274275
uint64_t sysdict;
275276
uint64_t builtins;
276277
uint64_t ceval_gil;
278+
uint64_t gil_runtime_state;
279+
uint64_t gil_runtime_state_enabled;
277280
uint64_t gil_runtime_state_locked;
278281
uint64_t gil_runtime_state_holder;
279282
} interpreter_state;
@@ -330,22 +333,64 @@ typedef struct _Py_DebugOffsets
330333
{
331334
uint64_t size;
332335
uint64_t tp_name;
336+
uint64_t tp_repr;
337+
uint64_t tp_flags;
333338
} type_object;
334339

335340
// PyTuple object offset;
336341
struct _tuple_object
337342
{
338343
uint64_t size;
339344
uint64_t ob_item;
345+
uint64_t ob_size;
340346
} tuple_object;
341347

348+
// PyList object offset;
349+
struct _list_object
350+
{
351+
uint64_t size;
352+
uint64_t ob_item;
353+
uint64_t ob_size;
354+
} list_object;
355+
356+
// PyDict object offset;
357+
struct _dict_object
358+
{
359+
uint64_t size;
360+
uint64_t ma_keys;
361+
uint64_t ma_values;
362+
} dict_object;
363+
364+
// PyFloat object offset;
365+
struct _float_object
366+
{
367+
uint64_t size;
368+
uint64_t ob_fval;
369+
} float_object;
370+
371+
// PyLong object offset;
372+
struct _long_object
373+
{
374+
uint64_t size;
375+
uint64_t lv_tag;
376+
uint64_t ob_digit;
377+
} long_object;
378+
379+
// PyBytes object offset;
380+
struct _bytes_object
381+
{
382+
uint64_t size;
383+
uint64_t ob_size;
384+
uint64_t ob_sval;
385+
} bytes_object;
386+
342387
// Unicode object offset;
343388
struct _unicode_object
344389
{
345390
uint64_t size;
346391
uint64_t state;
347392
uint64_t length;
348-
size_t asciiobject_size;
393+
uint64_t asciiobject_size;
349394
} unicode_object;
350395

351396
// GC runtime state offset;

src/pystack/_pystack/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ struct py_runtime_v
191191
FieldOffset<uint64_t> o_dbg_off_unicode_object_struct_size;
192192
FieldOffset<uint64_t> o_dbg_off_unicode_object_state;
193193
FieldOffset<uint64_t> o_dbg_off_unicode_object_length;
194-
FieldOffset<size_t> o_dbg_off_unicode_object_asciiobject_size;
194+
FieldOffset<uint64_t> o_dbg_off_unicode_object_asciiobject_size;
195195

196196
FieldOffset<uint64_t> o_dbg_off_gc_struct_size;
197197
FieldOffset<uint64_t> o_dbg_off_gc_collecting;

0 commit comments

Comments
 (0)