diff --git a/traceback.vp b/traceback.vp index 212cfea..17d5048 100644 --- a/traceback.vp +++ b/traceback.vp @@ -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)