Python 3.13 adds a new _Py_DebugOffsets structure to _PyRuntimeState which tells us more or less everything that we need to know in order to decode the interpreter's data structures. Look for this structure and, if we find it, use the offsets contained in it rather than the offsets compiled into pystack at build time.
This allows us to decode stacks for interpreters with different build time sizes of different structures, including those running in a python3.13t free-threaded interpreter.
@pablogsal I've addressed all of your suggestions. I've also rebased this on main, and fixed conflicts that arose due to the fix for handling shim frames. Take another look when you get a chance, please.
Python 3.13 adds a new
_Py_DebugOffsets
structure to_PyRuntimeState
which tells us more or less everything that we need to know in order to decode the interpreter's data structures. Look for this structure and, if we find it, use the offsets contained in it rather than the offsets compiled into pystack at build time.This allows us to decode stacks for interpreters with different build time sizes of different structures, including those running in a
python3.13t
free-threaded interpreter.