-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
gh-131591: Add remote debugging attachment protocol documentation #132638
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
base: main
Are you sure you want to change the base?
gh-131591: Add remote debugging attachment protocol documentation #132638
Conversation
Add a developer-facing document describing the protocol used by remote_exec(pid, script) to execute Python code in a running process. This is intended to guide debugger and tool authors in reimplementing the protocol.
21b4799
to
34c64f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, very clearly written.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a quick look at the first section. (Edit: I was reviewing when Hugo posted his, there is some overlap)
Everything needs to be wrapped to 79 chars -- this affects almost every line.
This is a spec so we should write in a more formal way. The formal tone is better suited for this technical documentation because it establishes the necessary precision required when explaining technical operations like memory manipulation and code injection. This formality isn't just stylistic preference—it serves a functional purpose by reducing ambiguity. @ivonastojanovic here are a bunch of advice on how to change the tone:
|
Maybe a short summary about the life time of the remote script shall be added to the documentation, too? |
a8e5827
to
bb9d85d
Compare
Doc/howto/remote_debugging.rst
Outdated
:file:`python{XY}.dll`, where ``X`` and ``Y`` are the major and minor | ||
version numbers of the Python version (for example, ``python311.dll``), and | ||
record its base address. | ||
3. Locate the ``PyRuntim`` section. Section names in the PE format are limited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Locate the ``PyRuntim`` section. Section names in the PE format are limited | |
3. Locate the ``PyRuntime`` section. Section names in the PE format are limited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's no typo and due to the 8 byte length limit in the PE format. Maybe that should be reformulated to make it clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the explanation to clarify the PE section name limit. Let me know what you think.
📚 Documentation preview 📚: https://cpython-previews--132638.org.readthedocs.build/en/132638/howto/remote_debugging.html