aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2025-05-25 21:19:29 +0100
committerGitHub <noreply@github.com>2025-05-25 20:19:29 +0000
commit42b25ad4d3d6bcdc28ddfe07d2bf8831378bb0d1 (patch)
tree1931ea801644e09403345214330a7e3fba376f89 /Python/sysmodule.c
parent328a778db8cc6ecadf0964a8e6a1834078b2d0d3 (diff)
downloadcpython-42b25ad4d3d6bcdc28ddfe07d2bf8831378bb0d1.tar.gz
cpython-42b25ad4d3d6bcdc28ddfe07d2bf8831378bb0d1.zip
gh-91048: Refactor and optimize remote debugging module (#134652)
Completely refactor Modules/_remote_debugging_module.c with improved code organization, replacing scattered reference counting and error handling with centralized goto error paths. This cleanup improves maintainability and reduces code duplication throughout the module while preserving the same external API. Implement memory page caching optimization in Python/remote_debug.h to avoid repeated reads of the same memory regions during debugging operations. The cache stores previously read memory pages and reuses them for subsequent reads, significantly reducing system calls and improving performance. Add code object caching mechanism with a new code_object_generation field in the interpreter state that tracks when code object caches need invalidation. This allows efficient reuse of parsed code object metadata and eliminates redundant processing of the same code objects across debugging sessions. Optimize memory operations by replacing multiple individual structure copies with single bulk reads for the same data structures. This reduces the number of memory operations and system calls required to gather debugging information from the target process. Update Makefile.pre.in to include Python/remote_debug.h in the headers list, ensuring that changes to the remote debugging header force proper recompilation of dependent modules and maintain build consistency across the codebase. Also, make the module compatible with the free threading build as an extra :) Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Python/sysmodule.c')
0 files changed, 0 insertions, 0 deletions