FpDebug: asm-unwind, follow long jumps

This commit is contained in:
Martin 2025-02-26 18:53:39 +01:00
parent 4b04ea627b
commit bef76faa45

View File

@ -5695,7 +5695,7 @@ var
var
MaxAddr, StartStack, Tmp: TDBGPtr;
BackwardJumpAddress: TAlternativeAddressPoint;
BackwardJumpAddress, ForwardJumpAddress: TAlternativeAddressPoint;
Cnt: Integer;
instr: TX86AsmInstruction;
RSize: Cardinal;
@ -5711,6 +5711,7 @@ begin
StartStack := AStackPtr;
CurConditionalForwardAddr := -1;
BackwardJumpAddress.Address := 0;
ForwardJumpAddress.Address := 0;
WeakResultAddress := 0;
try
@ -5746,6 +5747,13 @@ begin
ContinueAt(BackwardJumpAddress);
BackwardJumpAddress.Address := 0;
end
else
if (ForwardJumpAddress.Address > 0) and (not AddrWasDone(ForwardJumpAddress.Address)) then begin
ContinueAt(ForwardJumpAddress);
ForwardJumpAddress.Address := 0;
MaxAddr := NewAddr + MAX_SEARCH_ADDR;
MaxAddrCurrentBlock := MaxAddr;
end
else
exit;
StartNextAddrBlock;
@ -6182,6 +6190,13 @@ begin
continue;
end;
if Tmp > MaxAddr then begin
if (ForwardJumpAddress.Address = 0) or (Tmp < ForwardJumpAddress.Address) then
StoreAltAddr(ForwardJumpAddress, Tmp);
ForceDifferentBranch := True;
continue;
end;
FinishCurAddrBlock;
NewAddr := Tmp;
StartNextAddrBlock;