From ba50433cd5ba2ed843a6fd9aad6e0dc80d886cf4 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 27 Sep 2026 19:13:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(traceback):=20=E8=A1=A5=E5=9B=9E=20RbpFrame?= =?UTF-8?q?s=20=E5=A3=B0=E6=98=8E=EF=BC=8845d9b55=20=E5=8F=AA=E5=B8=A6?= =?UTF-8?q?=E4=B8=8A=E4=BA=86=E9=97=A8=E6=A7=9B=E6=94=B9=E5=8A=A8=EF=BC=8C?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=8A=A5=E6=9C=AA=E5=AE=9A=E4=B9=89=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dbghelp 门槛已改写为 if RbpFrames <= 1,但 RbpFrames: int = Frames 的声明未随该提交落盘 -> TPV 重编时 NameError: 未定义名称 RbpFrames(traceback.vp:1635) --- traceback.vp | 7 +++++++ 1 file changed, 7 insertions(+) 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)