From 97c7e680b7085fea3fb4bd5bf8fd682c5aa3d85b Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 7 Oct 2023 14:06:07 +0200 Subject: [PATCH] FpDebug: fixes for stack frame search --- components/fpdebug/fpdbgdisasx86.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/fpdebug/fpdbgdisasx86.pp b/components/fpdebug/fpdbgdisasx86.pp index b8f79be0b8..bd45882803 100644 --- a/components/fpdebug/fpdbgdisasx86.pp +++ b/components/fpdebug/fpdbgdisasx86.pp @@ -5221,7 +5221,7 @@ function TX86AsmDecoder.UnwindFrame(var AnAddress, AStackPtr, function IsRegister(Val, Reg: String): boolean; begin - Result := (Length(val) >= 2) and (val[1] in ['r', 'e']) and (strlcomp(@Val[2], PChar(Reg), Length(Reg)) = 0); + Result := (Length(Val) = Length(Reg) + 1) and (Length(val) >= 2) and (val[1] in ['r', 'e']) and (strlcomp(@Val[2], PChar(Reg), Length(Reg)) = 0); end; function RegisterSize(Reg: String): Cardinal; begin @@ -5258,7 +5258,9 @@ begin instr := TX86AsmInstruction(GetInstructionInfo(NewAddr)); if instr.InstructionLength <= 0 then exit; + {$PUSH}{$R-}{$Q-} NewAddr := NewAddr + instr.InstructionLength; + {$POP} CurAddr := @instr.FCodeBin[0]; case instr.X86OpCode of