mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 12:59:14 +02:00
FpDebug: improve TX86AsmDecoder.UnwindFrame
This commit is contained in:
parent
6f26574f55
commit
8e2532bdfc
@ -5495,8 +5495,29 @@ var
|
|||||||
{$POP}
|
{$POP}
|
||||||
else
|
else
|
||||||
if (Oper.Value = '%s') and (not(ofMemory in Oper.Flags))
|
if (Oper.Value = '%s') and (not(ofMemory in Oper.Flags))
|
||||||
then
|
then begin
|
||||||
AVal := TDBGPtr(OpVal) // constant
|
AVal := TDBGPtr(OpVal) // constant
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (ofMemory in Oper.Flags) then begin
|
||||||
|
FullName := FullRegisterName(Oper.Value);
|
||||||
|
AVal := 0;
|
||||||
|
if (LowerCase(FullName)+'%s' = LowerCase(Oper.Value)) then begin
|
||||||
|
r := ARegisterValueList.FindRegisterByName(FullName);
|
||||||
|
if r = nil then
|
||||||
|
exit(False);
|
||||||
|
|
||||||
|
AVal := r.NumValue;
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
|
if (AVal >= NewStack) and (AVal < NewStack + 8192) then // only trust data from the stack
|
||||||
|
AVal := AVal + OpVal
|
||||||
|
else
|
||||||
|
AVal := 0;
|
||||||
|
{$POP}
|
||||||
|
end;
|
||||||
|
if AVal = 0 then
|
||||||
|
exit(False);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
exit(False);
|
exit(False);
|
||||||
end
|
end
|
||||||
@ -5691,8 +5712,9 @@ begin
|
|||||||
not(ofMemory in Instr.X86Instruction.Operand[1].Flags)
|
not(ofMemory in Instr.X86Instruction.Operand[1].Flags)
|
||||||
then begin
|
then begin
|
||||||
if not ValueFromOperand(instr.X86Instruction.Operand[2], Tmp) then
|
if not ValueFromOperand(instr.X86Instruction.Operand[2], Tmp) then
|
||||||
exit;
|
NewFrame := 0
|
||||||
NewFrame := Tmp;
|
else
|
||||||
|
NewFrame := Tmp;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
FullName := LowerCase(FullRegisterName(instr.X86Instruction.Operand[1].Value));
|
FullName := LowerCase(FullRegisterName(instr.X86Instruction.Operand[1].Value));
|
||||||
@ -5728,6 +5750,10 @@ begin
|
|||||||
{$PUSH}{$R-}{$Q-}
|
{$PUSH}{$R-}{$Q-}
|
||||||
NewFrame := NewFrame + Val;
|
NewFrame := NewFrame + Val;
|
||||||
{$POP}
|
{$POP}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if ValueFromOperand(instr.X86Instruction.Operand[2], Tmp, True) then begin
|
||||||
|
NewFrame := Tmp;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -5751,6 +5777,10 @@ begin
|
|||||||
NewStack := NewFrame + Val;
|
NewStack := NewFrame + Val;
|
||||||
{$POP}
|
{$POP}
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if ValueFromOperand(instr.X86Instruction.Operand[2], Tmp, True) then begin
|
||||||
|
NewStack := Tmp;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -5797,6 +5827,32 @@ begin
|
|||||||
{$POP}
|
{$POP}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
OPsub:
|
||||||
|
begin
|
||||||
|
if instr.X86Instruction.OperCnt <> 2 then
|
||||||
|
exit;
|
||||||
|
ClearRecValList := False;
|
||||||
|
ClearRegister(instr.X86Instruction.Operand[1].Value);
|
||||||
|
|
||||||
|
if IsRegister(instr.X86Instruction.Operand[1].Value, 'sp') and
|
||||||
|
not(ofMemory in Instr.X86Instruction.Operand[1].Flags)
|
||||||
|
then begin
|
||||||
|
if not ValueFromOperand(instr.X86Instruction.Operand[2], Tmp) then
|
||||||
|
exit;
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
|
NewStack := NewStack - int64(Tmp);
|
||||||
|
{$POP}
|
||||||
|
end;
|
||||||
|
if IsRegister(instr.X86Instruction.Operand[1].Value, 'bp') and
|
||||||
|
not(ofMemory in Instr.X86Instruction.Operand[1].Flags)
|
||||||
|
then begin
|
||||||
|
if not ValueFromOperand(instr.X86Instruction.Operand[2], Tmp) then
|
||||||
|
exit;
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
|
NewFrame := NewFrame - int64(Tmp);
|
||||||
|
{$POP}
|
||||||
|
end;
|
||||||
|
end;
|
||||||
OPj__:
|
OPj__:
|
||||||
if (not AQuick) and
|
if (not AQuick) and
|
||||||
(instr.X86Instruction.OperCnt = 1) and
|
(instr.X86Instruction.OperCnt = 1) and
|
||||||
|
Loading…
Reference in New Issue
Block a user