Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Commit1822f33
authored
gh-91048: Refactor and optimize remote debugging module (#134652)Completely refactor Modules/_remote_debugging_module.c with improvedcode organization, replacing scattered reference counting and errorhandling with centralized goto error paths. This cleanup improvesmaintainability and reduces code duplication throughout the module whilepreserving the same external API.Implement memory page caching optimization in Python/remote_debug.h toavoid repeated reads of the same memory regions during debuggingoperations. The cache stores previously read memory pages and reusesthem for subsequent reads, significantly reducing system calls andimproving performance.Add code object caching mechanism with a new code_object_generationfield in the interpreter state that tracks when code object caches needinvalidation. This allows efficient reuse of parsed code object metadataand eliminates redundant processing of the same code objects acrossdebugging sessions.Optimize memory operations by replacing multiple individual structurecopies with single bulk reads for the same data structures. This reducesthe number of memory operations and system calls required to gatherdebugging information from the target process.Update Makefile.pre.in to include Python/remote_debug.h in the headerslist, ensuring that changes to the remote debugging header force properrecompilation of dependent modules and maintain build consistency acrossthe codebase.Also, make the module compatible with the free threading build as an extra :)Co-authored-by: Łukasz Langa <lukasz@langa.pl>(cherry picked from commit42b25ad)
1 parentf68f05c commit1822f33
File tree
17 files changed
+5344
-3986
lines changed- Doc/data
- Include
- cpython
- internal
- Lib
- asyncio
- test
- Modules
- clinic
- Objects
- Python
17 files changed
+5344
-3986
lines changedLines changed: 2954 additions & 2928 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
| 65 | + | |
64 | 66 |
| |
65 | 67 |
| |
66 | 68 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| 57 | + | |
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
60 | 61 |
| |
61 | 62 |
| |
| 63 | + | |
62 | 64 |
| |
63 | 65 |
| |
64 | 66 |
| |
| |||
89 | 91 |
| |
90 | 92 |
| |
91 | 93 |
| |
| 94 | + | |
| 95 | + | |
92 | 96 |
| |
93 | 97 |
| |
94 | 98 |
| |
| |||
216 | 220 |
| |
217 | 221 |
| |
218 | 222 |
| |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
219 | 228 |
| |
220 | 229 |
| |
221 | 230 |
| |
| |||
251 | 260 |
| |
252 | 261 |
| |
253 | 262 |
| |
| 263 | + | |
| 264 | + | |
254 | 265 |
| |
255 | 266 |
| |
256 | 267 |
| |
| |||
347 | 358 |
| |
348 | 359 |
| |
349 | 360 |
| |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
350 | 365 |
| |
351 | 366 |
| |
352 | 367 |
| |
|
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
287 | 287 |
| |
288 | 288 |
| |
289 | 289 |
| |
| 290 | + | |
290 | 291 |
| |
291 | 292 |
| |
292 | 293 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
726 | 726 |
| |
727 | 727 |
| |
728 | 728 |
| |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
729 | 733 |
| |
730 | 734 |
| |
731 | 735 |
| |
| |||
843 | 847 |
| |
844 | 848 |
| |
845 | 849 |
| |
| 850 | + | |
| 851 | + | |
846 | 852 |
| |
847 | 853 |
| |
848 | 854 |
| |
|
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
4 | 3 |
| |
5 | 4 |
| |
6 | 5 |
| |
7 | 6 |
| |
8 |
| - | |
| 7 | + | |
9 | 8 |
| |
10 | 9 |
| |
11 | 10 |
| |
| |||
118 | 117 |
| |
119 | 118 |
| |
120 | 119 |
| |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 |
| |
122 | 126 |
| |
123 | 127 |
| |
|
Lines changed: 63 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
| |||
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
19 |
| - | |
20 |
| - | |
21 |
| - | |
| 20 | + | |
22 | 21 |
| |
23 | 22 |
| |
24 | 23 |
| |
| |||
34 | 33 |
| |
35 | 34 |
| |
36 | 35 |
| |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
37 | 51 |
| |
| 52 | + | |
38 | 53 |
| |
39 | 54 |
| |
40 | 55 |
| |
| |||
46 | 61 |
| |
47 | 62 |
| |
48 | 63 |
| |
49 |
| - | |
| 64 | + | |
50 | 65 |
| |
51 | 66 |
| |
52 | 67 |
| |
| |||
55 | 70 |
| |
56 | 71 |
| |
57 | 72 |
| |
| 73 | + | |
58 | 74 |
| |
59 | 75 |
| |
60 | 76 |
| |
61 | 77 |
| |
62 |
| - | |
| 78 | + | |
63 | 79 |
| |
64 |
| - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
65 | 83 |
| |
66 | 84 |
| |
67 | 85 |
| |
| |||
82 | 100 |
| |
83 | 101 |
| |
84 | 102 |
| |
85 |
| - | |
86 |
| - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
87 | 106 |
| |
88 | 107 |
| |
89 | 108 |
| |
| |||
94 | 113 |
| |
95 | 114 |
| |
96 | 115 |
| |
97 |
| - | |
98 |
| - | |
99 |
| - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
100 | 119 |
| |
101 |
| - | |
| 120 | + | |
102 | 121 |
| |
103 |
| - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
104 | 133 |
| |
105 | 134 |
| |
106 | 135 |
| |
| |||
700 | 729 |
| |
701 | 730 |
| |
702 | 731 |
| |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
703 | 740 |
| |
704 |
| - | |
705 |
| - | |
706 |
| - | |
707 |
| - | |
708 |
| - | |
709 |
| - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
710 | 754 |
| |
711 | 755 |
| |
712 | 756 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1206 | 1206 |
| |
1207 | 1207 |
| |
1208 | 1208 |
| |
| 1209 | + | |
1209 | 1210 |
| |
1210 | 1211 |
| |
1211 | 1212 |
| |
|
0 commit comments
Comments
(0)