Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a collection of offsets to facilitate the work of out-of-process debuggers #106597

Closed
pablogsal opened this issue Jul 10, 2023 · 2 comments
Closed

Comments

@pablogsal
Copy link
Member

pablogsal commented Jul 10, 2023

Some of the relevant fields in the interpreter state and the frame state in 3.12 are very challenging to fetch from out-of-process tools because they are in offsets that depend on compilation or platform variables that are different in different platforms. Not only that but they require the tools to copy a huge amount of intermediate structures making the whole thing very verbose.

To allow out-of-process tools to get these offsets without having to copy the headers (which also doesn't really work as some of these fields may depend on compilation flags and other parameters), add a debugging struct to the runtime state (which is the entry point many of these tools need anyway) that contain a list of the offsets that are relevant for out-of-process tools.

This list will not be backward compatible between minor versions but is expected to reflect the relevant fields for all the life of a minor version.

We can add more fields to the struct in the future at our leisure.

See #106140 and #100987 and #105271 for more information.

Linked PRs

@hugovk
Copy link
Member

hugovk commented Nov 10, 2023

Is there more to do here, or can we close this issue?

@pablogsal
Copy link
Member Author

We can close it for now 👍

pablogsal pushed a commit that referenced this issue Jul 3, 2024
Add more offsets to _Py_DebugOffsets

We add a few more offsets that are required by some out-of-process
tools, such as [Austin](https://github.com/p403n1x87/austin).
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 3, 2024
Add more offsets to _Py_DebugOffsets

We add a few more offsets that are required by some out-of-process
tools, such as [Austin](https://github.com/p403n1x87/austin).
(cherry picked from commit c9bdfbe)

Co-authored-by: Gabriele N. Tornetta <[email protected]>
pablogsal pushed a commit that referenced this issue Jul 3, 2024
…121312)

gh-106597: Add more offsets to _Py_DebugOffsets (GH-121311)

Add more offsets to _Py_DebugOffsets

We add a few more offsets that are required by some out-of-process
tools, such as [Austin](https://github.com/p403n1x87/austin).
(cherry picked from commit c9bdfbe)

Co-authored-by: Gabriele N. Tornetta <[email protected]>
P403n1x87 added a commit to P403n1x87/cpython that referenced this issue Jul 4, 2024
The PyCFrame structure has been removed in 3.13 therefore its offsets
are no longer available to be exported via the debug offsets structure.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 4, 2024
(cherry picked from commit f5c8d67)

Co-authored-by: Gabriele N. Tornetta <[email protected]>
vstinner pushed a commit that referenced this issue Jul 4, 2024
)

gh-106597: Remove unnecessary CFrame offsets (GH-121369)
(cherry picked from commit f5c8d67)

Co-authored-by: Gabriele N. Tornetta <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
Add more offsets to _Py_DebugOffsets

We add a few more offsets that are required by some out-of-process
tools, such as [Austin](https://github.com/p403n1x87/austin).
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Add more offsets to _Py_DebugOffsets

We add a few more offsets that are required by some out-of-process
tools, such as [Austin](https://github.com/p403n1x87/austin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants