Commit 0193cb6
committed
Fix GDB JIT unwind info and harden the tests
The GDB CFI hand-rolled in jit_unwind.c couldn't correctly describe the
compiled shim's prologue on AArch64 and relied on hardcoded offsets
that would silently invalidate under any compiler/flag change. Tools/jit
now compiles shim.c with -fasynchronous-unwind-tables, extracts its
.eh_frame at build time, and ships the CIE/FDE CFI bytes as a blob in
jit_stencils.h; jit_unwind.c splices those bytes into the synthetic
EH frame at runtime, so whatever prologue clang emits is described
accurately. Executor regions keep the hand-written steady-state rule,
which is our pinned-frame-pointer invariant (enforced by
Tools/jit/_optimizers.py _validate()), not a guess at compiler output.
Also: "Backtrace stopped: frame did not save the PC" is now a hard
AssertionError instead of a silent skip (it always indicates a real
unwind bug), and the three JIT tests share a get_stack_trace override
that opts out of the generic "?? ()" skip so unrelated libc-without-
debug-info frames don't mask a passing test.1 parent 6ee9fbc commit 0193cb6
File tree
10 files changed
+374
-91
lines changed- Include/internal
- Lib/test/test_gdb
- Python
- Tools/jit
10 files changed
+374
-91
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
11 | 34 | | |
12 | 35 | | |
13 | 36 | | |
| |||
35 | 58 | | |
36 | 59 | | |
37 | 60 | | |
38 | | - | |
| 61 | + | |
| 62 | + | |
39 | 63 | | |
40 | 64 | | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
44 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
45 | 74 | | |
46 | 75 | | |
47 | 76 | | |
48 | | - | |
| 77 | + | |
| 78 | + | |
49 | 79 | | |
50 | 80 | | |
51 | 81 | | |
52 | 82 | | |
53 | | - | |
| 83 | + | |
| 84 | + | |
54 | 85 | | |
55 | 86 | | |
56 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
138 | 159 | | |
139 | 160 | | |
140 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
23 | 44 | | |
24 | 45 | | |
25 | 46 | | |
| |||
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
| 185 | + | |
164 | 186 | | |
165 | 187 | | |
166 | 188 | | |
| |||
256 | 278 | | |
257 | 279 | | |
258 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
259 | 289 | | |
260 | 290 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
279 | 295 | | |
280 | 296 | | |
281 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
765 | | - | |
| 767 | + | |
| 768 | + | |
766 | 769 | | |
767 | 770 | | |
768 | 771 | | |
| |||
813 | 816 | | |
814 | 817 | | |
815 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
816 | 837 | | |
817 | 838 | | |
818 | 839 | | |
819 | | - | |
| 840 | + | |
| 841 | + | |
820 | 842 | | |
821 | 843 | | |
822 | 844 | | |
| |||
0 commit comments