mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 07:19:22 +02:00
FpDebug: Prevent range checks on target address computation
(cherry picked from commit ad54dc2ceb
)
This commit is contained in:
parent
b0867a7674
commit
43569dfc6a
@ -4460,7 +4460,9 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
DW_LNS_advance_pc: begin
|
DW_LNS_advance_pc: begin
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
Inc(FAddress, ULEB128toOrdinal(pbyte(FLineInfoPtr)));
|
Inc(FAddress, ULEB128toOrdinal(pbyte(FLineInfoPtr)));
|
||||||
|
{$POP}
|
||||||
end;
|
end;
|
||||||
DW_LNS_advance_line: begin
|
DW_LNS_advance_line: begin
|
||||||
Inc(FLine, SLEB128toOrdinal(pbyte(FLineInfoPtr)));
|
Inc(FLine, SLEB128toOrdinal(pbyte(FLineInfoPtr)));
|
||||||
@ -4479,12 +4481,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
DW_LNS_const_add_pc: begin
|
DW_LNS_const_add_pc: begin
|
||||||
Opcode := 255 - Length(FOwner.FLineInfo.StandardOpcodeLengths);
|
Opcode := 255 - Length(FOwner.FLineInfo.StandardOpcodeLengths);
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
if FOwner.FLineInfo.LineRange = 0
|
if FOwner.FLineInfo.LineRange = 0
|
||||||
then Inc(FAddress, Opcode * FOwner.FLineInfo.MinimumInstructionLength)
|
then Inc(FAddress, Opcode * FOwner.FLineInfo.MinimumInstructionLength)
|
||||||
else Inc(FAddress, (Opcode div FOwner.FLineInfo.LineRange) * FOwner.FLineInfo.MinimumInstructionLength);
|
else Inc(FAddress, (Opcode div FOwner.FLineInfo.LineRange) * FOwner.FLineInfo.MinimumInstructionLength);
|
||||||
|
{$POP}
|
||||||
end;
|
end;
|
||||||
DW_LNS_fixed_advance_pc: begin
|
DW_LNS_fixed_advance_pc: begin
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
Inc(FAddress, PWord(FLineInfoPtr)^);
|
Inc(FAddress, PWord(FLineInfoPtr)^);
|
||||||
|
{$POP}
|
||||||
Inc(pbyte(FLineInfoPtr), 2);
|
Inc(pbyte(FLineInfoPtr), 2);
|
||||||
end;
|
end;
|
||||||
DW_LNS_set_prologue_end: begin
|
DW_LNS_set_prologue_end: begin
|
||||||
@ -4547,6 +4553,7 @@ begin
|
|||||||
|
|
||||||
// Special opcode
|
// Special opcode
|
||||||
Dec(Opcode, Length(FOwner.FLineInfo.StandardOpcodeLengths)+1);
|
Dec(Opcode, Length(FOwner.FLineInfo.StandardOpcodeLengths)+1);
|
||||||
|
{$PUSH}{$R-}{$Q-}
|
||||||
if FOwner.FLineInfo.LineRange = 0
|
if FOwner.FLineInfo.LineRange = 0
|
||||||
then begin
|
then begin
|
||||||
Inc(FAddress, Opcode * FOwner.FLineInfo.MinimumInstructionLength);
|
Inc(FAddress, Opcode * FOwner.FLineInfo.MinimumInstructionLength);
|
||||||
@ -4555,6 +4562,7 @@ begin
|
|||||||
Inc(FAddress, (Opcode div FOwner.FLineInfo.LineRange) * FOwner.FLineInfo.MinimumInstructionLength);
|
Inc(FAddress, (Opcode div FOwner.FLineInfo.LineRange) * FOwner.FLineInfo.MinimumInstructionLength);
|
||||||
Inc(FLine, FOwner.FLineInfo.LineBase + (Opcode mod FOwner.FLineInfo.LineRange));
|
Inc(FLine, FOwner.FLineInfo.LineBase + (Opcode mod FOwner.FLineInfo.LineRange));
|
||||||
end;
|
end;
|
||||||
|
{$POP}
|
||||||
Result := True;
|
Result := True;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user