FpDebug: Handle overflow for relocation with 32bit target. RelocationOffset is stored as QWord, but can be negative. For 32bit targets the overflow must be masked out.

This commit is contained in:
Martin 2023-10-14 14:05:39 +02:00
parent a6999c26a6
commit 0fad4e40d9
2 changed files with 4 additions and 2 deletions

View File

@ -5386,6 +5386,8 @@ begin
{$push}
{$Q-}{$R-}
Result := AValue + FOwner.RelocationOffset;
if FAddressSize = 4 then
Result := DWORD(Result);
{$pop}
end;

View File

@ -531,8 +531,8 @@ begin
SymbolName:=pchar(SymbolStr+SymbolArr32^[i].st_name);
{$Q-}{$R-}
AfpSymbolInfo.Add(SymbolName, TDBGPtr(SymbolArr32^[i].st_value+RelocationOffset),
Sect^.Address + Sect^.Size+RelocationOffset);
AfpSymbolInfo.Add(SymbolName, DWord(SymbolArr32^[i].st_value+RelocationOffset),
DWORD(Sect^.Address + Sect^.Size+RelocationOffset));
end;
{$pop}
end