FpDebug: Removed TDbgInstance.AddrOffset and other old attempts to relocate libraries properly

This commit is contained in:
Joost van der Sluis 2021-12-07 23:56:42 +01:00
parent 2ad53a8a51
commit de0974f29e
3 changed files with 3 additions and 27 deletions

View File

@ -477,7 +477,6 @@ type
function AddBreak(const AFileName: String; ALine: Cardinal; AnEnabled: Boolean = True): TFpInternalBreakpoint; overload;
function AddBreak(const AFuncName: String; AnEnabled: Boolean = True): TFpDbgBreakpoint; overload;
function AddrOffset: TDBGPtr; virtual; // gives the offset between the loaded addresses and the compiled addresses
function FindProcSymbol(const AName: String): TFpSymbol; overload;
function FindProcSymbol(AAdress: TDbgPtr): TFpSymbol; overload;
function FindProcStartEndPC(AAdress: TDbgPtr; out AStartPC, AEndPC: TDBGPtr): boolean;
@ -1606,16 +1605,10 @@ function TDbgInstance.AddBreak(const AFileName: String; ALine: Cardinal;
AnEnabled: Boolean): TFpInternalBreakpoint;
var
addr: TDBGPtrArray;
o: Int64;
i: Integer;
begin
Result := nil;
if GetLineAddresses(AFileName, ALine, addr) then begin
o := AddrOffset;
for i := 0 to High(addr) do
addr[i] := addr[i] - o;
if GetLineAddresses(AFileName, ALine, addr) then
Result := FProcess.AddBreak(addr, AnEnabled);
end;
end;
function TDbgInstance.AddBreak(const AFuncName: String; AnEnabled: Boolean
@ -1631,11 +1624,6 @@ begin
end;
end;
function TDbgInstance.AddrOffset: TDBGPtr;
begin
Result := FLoaderList.ImageBase;
end;
function TDbgInstance.FindProcSymbol(const AName: String): TFpSymbol;
begin
if FDbgInfo <> nil then
@ -1674,7 +1662,7 @@ end;
function TDbgInstance.FindProcSymbol(AAdress: TDbgPtr): TFpSymbol;
begin
{$PUSH}{$R-}{$Q-}
AAdress := AAdress + AddrOffset;
AAdress := AAdress;
{$POP}
Result := FDbgInfo.FindProcSymbol(AAdress);
if not assigned(Result) then
@ -1685,7 +1673,7 @@ function TDbgInstance.FindProcStartEndPC(AAdress: TDbgPtr; out AStartPC,
AEndPC: TDBGPtr): boolean;
begin
{$PUSH}{$R-}{$Q-}
AAdress := AAdress + AddrOffset;
AAdress := AAdress;
{$POP}
Result := FDbgInfo.FindProcStartEndPC(AAdress, AStartPC, AEndPC);
end;

View File

@ -767,7 +767,6 @@ type
AFindSibling: TGetLineAddrFindSibling = fsNone; AFoundLine: PInteger = nil): Boolean; override;
function GetLineAddressMap(const AFileName: String): PDWarfLineMap;
function LoadCompilationUnits: Integer;
function PointerFromRVA(ARVA: QWord): Pointer;
function CompilationUnitsCount: Integer; inline;
property CompilationUnits[AIndex: Integer]: TDwarfCompilationUnit read GetCompilationUnit;
@ -3940,11 +3939,6 @@ begin
TDwarfCompilationUnit(FCompilationUnits[i]).FComputeNameHashesWorker.MarkReadyToRun;
end;
function TFpDwarfInfo.PointerFromRVA(ARVA: QWord): Pointer;
begin
Result := Pointer(PtrUInt(FImageBase + ARVA));
end;
function TFpDwarfInfo.CompilationUnitsCount: Integer;
begin
Result := FCompilationUnits.Count;

View File

@ -215,7 +215,6 @@ type
procedure TerminateProcess; override;
function AddrOffset: TDBGPtr; override;
function AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
procedure RemoveLib(const AInfo: TUnloadDLLDebugInfo);
end;
@ -1380,11 +1379,6 @@ begin
FTerminated := True;
end;
function TDbgWinProcess.AddrOffset: TDBGPtr;
begin
Result:=0;//inherited AddrOffset - TDbgPtr(FInfo.lpBaseOfImage);
end;
function TDbgWinProcess.AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
var
ID: TDbgPtr;