mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 20:09:27 +02:00
FpDebug: asm-unwind, improve handling of jump
This commit is contained in:
parent
10254a7769
commit
f1941c9cce
@ -5480,6 +5480,9 @@ var
|
|||||||
if (IsRegister(Oper.Value, 'sp')) then
|
if (IsRegister(Oper.Value, 'sp')) then
|
||||||
AVal := NewStack
|
AVal := NewStack
|
||||||
else
|
else
|
||||||
|
if (IsRegister(Oper.Value, 'ip')) then
|
||||||
|
AVal := NewAddr
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
FullName := FullRegisterName(Oper.Value);
|
FullName := FullRegisterName(Oper.Value);
|
||||||
if (LowerCase(FullName) = LowerCase(Oper.Value)) then begin
|
if (LowerCase(FullName) = LowerCase(Oper.Value)) then begin
|
||||||
@ -5511,6 +5514,12 @@ var
|
|||||||
{$POP}
|
{$POP}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
if (IsRegister(Oper.Value, 'ip%s')) then begin
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
|
AVal := NewAddr + OpVal;
|
||||||
|
{$POP}
|
||||||
|
end
|
||||||
|
else
|
||||||
if (Oper.Value = '%s') and (not(ofMemory in Oper.Flags))
|
if (Oper.Value = '%s') and (not(ofMemory in Oper.Flags))
|
||||||
then begin
|
then begin
|
||||||
AVal := TDBGPtr(OpVal) // constant
|
AVal := TDBGPtr(OpVal) // constant
|
||||||
@ -6104,10 +6113,6 @@ begin
|
|||||||
ForceDifferentBranch := True;
|
ForceDifferentBranch := True;
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
if (instr.X86Instruction.Operand[1].Value <> '%s') then begin
|
|
||||||
ForceDifferentBranch := True;
|
|
||||||
continue;
|
|
||||||
end;
|
|
||||||
if (Instr.X86Instruction.Operand[1].ByteCount = 0) or
|
if (Instr.X86Instruction.Operand[1].ByteCount = 0) or
|
||||||
(Instr.X86Instruction.Operand[1].ByteCount2 <> 0)
|
(Instr.X86Instruction.Operand[1].ByteCount2 <> 0)
|
||||||
then begin
|
then begin
|
||||||
@ -6115,10 +6120,29 @@ begin
|
|||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Val := ValueFromMem(CurAddr[Instr.X86Instruction.Operand[1].CodeIndex], Instr.X86Instruction.Operand[1].ByteCount, Instr.X86Instruction.Operand[1].FormatFlags);
|
if (instr.X86Instruction.Operand[1].Value = '%s') then begin
|
||||||
{$PUSH}{$R-}{$Q-}
|
Val := ValueFromMem(CurAddr[Instr.X86Instruction.Operand[1].CodeIndex], Instr.X86Instruction.Operand[1].ByteCount, Instr.X86Instruction.Operand[1].FormatFlags);
|
||||||
Tmp := NewAddr + Val;
|
{$PUSH}{$R-}{$Q-}
|
||||||
{$POP}
|
Tmp := NewAddr + Val;
|
||||||
|
{$POP}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (instr.X86Instruction.Operand[1].Value = 'rip%s') or
|
||||||
|
(instr.X86Instruction.Operand[1].Value = 'eip%s')
|
||||||
|
then begin
|
||||||
|
if not ValueFromOperand(instr.X86Instruction.Operand[1], Tmp) then begin
|
||||||
|
ForceDifferentBranch := True;
|
||||||
|
continue;
|
||||||
|
end;
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
|
Val := Tmp - NewAddr;
|
||||||
|
{$POP}
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
ForceDifferentBranch := True;
|
||||||
|
continue;
|
||||||
|
end;
|
||||||
|
|
||||||
if (Val < 0) then begin
|
if (Val < 0) then begin
|
||||||
CheckConditionalForwAddr;
|
CheckConditionalForwAddr;
|
||||||
if (CurConditionalForwardAddr >= 0) then begin
|
if (CurConditionalForwardAddr >= 0) then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user