fix(traceback): 补回 RbpFrames 声明(45d9b55 只带上了门槛改动,编译报未定义名称)

dbghelp 门槛已改写为 if RbpFrames <= 1,但 RbpFrames: int = Frames 的声明未随该提交落盘 -> TPV 重编时 NameError: 未定义名称 RbpFrames(traceback.vp:1635)
This commit is contained in:
TermiNexus committed 2026-09-27 19:13:32 +08:00
1 parent 45d9b55931
commit ba50433cd5
1 file changed
+7
+7
View File
@@ -1612,6 +1612,13 @@ def DumpMainThread(IsBreak: int) -> int:
EmitText(" [diag] walk: primary=rbp_chain\n")
# ---- Primary path: RBP chain (no dbghelp) ----
Frames = WalkRbpChain(Rip, Rbp, Base)
# RBP-chain yield ALONE decides the fallback gates below. The stack scan must not mask the
# (far stronger) dbghelp unwinder by inflating this count first: measured on
# Test/LLvmLiteTest, RBP was 0 (the main thread was blocked inside a system DLL), the chain
# produced the single RIP frame, the scan added 1 inferred candidate -> Frames became 2 ->
# the `Frames <= 1` dbghelp gate below silently skipped StackWalk64, which is the only path
# able to unwind through the frameless ntdll/kernel32 frames and print the real .vp stack.
RbpFrames: int = Frames
if DiagEnabled() != 0:
N = stdio.snprintf(_State.LineBuf, t.CSizeT(TRACEBACK_LINE_CAP),
" [diag] walk: rbp_chain frames=%d\n", Frames)