()
| 114 | |
| 115 | |
| 116 | def _annotate_unwind(): |
| 117 | stack = _build_stack_and_unwind() |
| 118 | jit_enabled = hasattr(sys, "_jit") and sys._jit.is_enabled() |
| 119 | jit_backend = _testinternalcapi.get_jit_backend() |
| 120 | ranges = _testinternalcapi.get_jit_code_ranges() if jit_enabled else [] |
| 121 | if jit_enabled and ranges: |
| 122 | print("JIT ranges:") |
| 123 | for start, end in ranges: |
| 124 | print(f" {int(start):#x}-{int(end):#x}") |
| 125 | annotated, python_frames, jit_frames, other_frames = _classify_stack( |
| 126 | stack, jit_enabled |
| 127 | ) |
| 128 | for idx, addr, tag in annotated: |
| 129 | print(f"#{idx:02d} {addr:#x} -> {tag}") |
| 130 | return json.dumps({ |
| 131 | "length": len(stack), |
| 132 | "python_frames": python_frames, |
| 133 | "jit_frames": jit_frames, |
| 134 | "other_frames": other_frames, |
| 135 | "jit_backend": jit_backend, |
| 136 | }) |
| 137 | |
| 138 | |
| 139 | def _manual_unwind_length(**env): |
nothing calls this directly
no test coverage detected
searching dependent graphs…