MCPcopy Index your code
hub / github.com/python/cpython / _annotate_unwind

Function _annotate_unwind

Lib/test/test_frame_pointer_unwind.py:116–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115
116def _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
139def _manual_unwind_length(**env):

Callers

nothing calls this directly

Calls 3

_build_stack_and_unwindFunction · 0.85
_classify_stackFunction · 0.85
dumpsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…