Skip to content

Commit

Permalink
Update debug offsets for 3.13rc2
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
godlygeek authored and pablogsal committed Sep 11, 2024
1 parent 4653a98 commit 5942474
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
47 changes: 46 additions & 1 deletion src/pystack/_pystack/cpython/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ typedef struct _Py_DebugOffsets
{
char cookie[8];
uint64_t version;
uint64_t free_threaded;
// Runtime state offset;
struct _runtime_state
{
Expand All @@ -274,6 +275,8 @@ typedef struct _Py_DebugOffsets
uint64_t sysdict;
uint64_t builtins;
uint64_t ceval_gil;
uint64_t gil_runtime_state;
uint64_t gil_runtime_state_enabled;
uint64_t gil_runtime_state_locked;
uint64_t gil_runtime_state_holder;
} interpreter_state;
Expand Down Expand Up @@ -330,22 +333,64 @@ typedef struct _Py_DebugOffsets
{
uint64_t size;
uint64_t tp_name;
uint64_t tp_repr;
uint64_t tp_flags;
} type_object;

// PyTuple object offset;
struct _tuple_object
{
uint64_t size;
uint64_t ob_item;
uint64_t ob_size;
} tuple_object;

// PyList object offset;
struct _list_object
{
uint64_t size;
uint64_t ob_item;
uint64_t ob_size;
} list_object;

// PyDict object offset;
struct _dict_object
{
uint64_t size;
uint64_t ma_keys;
uint64_t ma_values;
} dict_object;

// PyFloat object offset;
struct _float_object
{
uint64_t size;
uint64_t ob_fval;
} float_object;

// PyLong object offset;
struct _long_object
{
uint64_t size;
uint64_t lv_tag;
uint64_t ob_digit;
} long_object;

// PyBytes object offset;
struct _bytes_object
{
uint64_t size;
uint64_t ob_size;
uint64_t ob_sval;
} bytes_object;

// Unicode object offset;
struct _unicode_object
{
uint64_t size;
uint64_t state;
uint64_t length;
size_t asciiobject_size;
uint64_t asciiobject_size;
} unicode_object;

// GC runtime state offset;
Expand Down
2 changes: 1 addition & 1 deletion src/pystack/_pystack/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct py_runtime_v
FieldOffset<uint64_t> o_dbg_off_unicode_object_struct_size;
FieldOffset<uint64_t> o_dbg_off_unicode_object_state;
FieldOffset<uint64_t> o_dbg_off_unicode_object_length;
FieldOffset<size_t> o_dbg_off_unicode_object_asciiobject_size;
FieldOffset<uint64_t> o_dbg_off_unicode_object_asciiobject_size;

FieldOffset<uint64_t> o_dbg_off_gc_struct_size;
FieldOffset<uint64_t> o_dbg_off_gc_collecting;
Expand Down

0 comments on commit 5942474

Please sign in to comment.