Python: write a tool to generate struct offsets #97
Labels
build
Related to the build system
help wanted
Extra attention is needed
python
Issue related to Python
Currently, field offsets in structs are hardcoded:
https://github.com/stealthrocket/wzprof/blob/ba3fa22d8ada53862bf029d023b7213bbcecc07c/python.go#L113-L153
They have been generated by adding the following C code inside CPython's 3.11
Python/sysmodule.c
:To support more versions of Python, we should build tooling to compute those offsets more easily. One approach may be to use CGo?
The other alternative may be to interpret the DWARF data, which should contain those offsets.
The text was updated successfully, but these errors were encountered: