mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 13:40:29 +02:00
FpDebug: Removed TDbgInstance.AddrOffset and other old attempts to relocate libraries properly
This commit is contained in:
parent
2ad53a8a51
commit
de0974f29e
@ -477,7 +477,6 @@ type
|
|||||||
|
|
||||||
function AddBreak(const AFileName: String; ALine: Cardinal; AnEnabled: Boolean = True): TFpInternalBreakpoint; overload;
|
function AddBreak(const AFileName: String; ALine: Cardinal; AnEnabled: Boolean = True): TFpInternalBreakpoint; overload;
|
||||||
function AddBreak(const AFuncName: String; AnEnabled: Boolean = True): TFpDbgBreakpoint; 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(const AName: String): TFpSymbol; overload;
|
||||||
function FindProcSymbol(AAdress: TDbgPtr): TFpSymbol; overload;
|
function FindProcSymbol(AAdress: TDbgPtr): TFpSymbol; overload;
|
||||||
function FindProcStartEndPC(AAdress: TDbgPtr; out AStartPC, AEndPC: TDBGPtr): boolean;
|
function FindProcStartEndPC(AAdress: TDbgPtr; out AStartPC, AEndPC: TDBGPtr): boolean;
|
||||||
@ -1606,16 +1605,10 @@ function TDbgInstance.AddBreak(const AFileName: String; ALine: Cardinal;
|
|||||||
AnEnabled: Boolean): TFpInternalBreakpoint;
|
AnEnabled: Boolean): TFpInternalBreakpoint;
|
||||||
var
|
var
|
||||||
addr: TDBGPtrArray;
|
addr: TDBGPtrArray;
|
||||||
o: Int64;
|
|
||||||
i: Integer;
|
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
if GetLineAddresses(AFileName, ALine, addr) then begin
|
if GetLineAddresses(AFileName, ALine, addr) then
|
||||||
o := AddrOffset;
|
|
||||||
for i := 0 to High(addr) do
|
|
||||||
addr[i] := addr[i] - o;
|
|
||||||
Result := FProcess.AddBreak(addr, AnEnabled);
|
Result := FProcess.AddBreak(addr, AnEnabled);
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDbgInstance.AddBreak(const AFuncName: String; AnEnabled: Boolean
|
function TDbgInstance.AddBreak(const AFuncName: String; AnEnabled: Boolean
|
||||||
@ -1631,11 +1624,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDbgInstance.AddrOffset: TDBGPtr;
|
|
||||||
begin
|
|
||||||
Result := FLoaderList.ImageBase;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDbgInstance.FindProcSymbol(const AName: String): TFpSymbol;
|
function TDbgInstance.FindProcSymbol(const AName: String): TFpSymbol;
|
||||||
begin
|
begin
|
||||||
if FDbgInfo <> nil then
|
if FDbgInfo <> nil then
|
||||||
@ -1674,7 +1662,7 @@ end;
|
|||||||
function TDbgInstance.FindProcSymbol(AAdress: TDbgPtr): TFpSymbol;
|
function TDbgInstance.FindProcSymbol(AAdress: TDbgPtr): TFpSymbol;
|
||||||
begin
|
begin
|
||||||
{$PUSH}{$R-}{$Q-}
|
{$PUSH}{$R-}{$Q-}
|
||||||
AAdress := AAdress + AddrOffset;
|
AAdress := AAdress;
|
||||||
{$POP}
|
{$POP}
|
||||||
Result := FDbgInfo.FindProcSymbol(AAdress);
|
Result := FDbgInfo.FindProcSymbol(AAdress);
|
||||||
if not assigned(Result) then
|
if not assigned(Result) then
|
||||||
@ -1685,7 +1673,7 @@ function TDbgInstance.FindProcStartEndPC(AAdress: TDbgPtr; out AStartPC,
|
|||||||
AEndPC: TDBGPtr): boolean;
|
AEndPC: TDBGPtr): boolean;
|
||||||
begin
|
begin
|
||||||
{$PUSH}{$R-}{$Q-}
|
{$PUSH}{$R-}{$Q-}
|
||||||
AAdress := AAdress + AddrOffset;
|
AAdress := AAdress;
|
||||||
{$POP}
|
{$POP}
|
||||||
Result := FDbgInfo.FindProcStartEndPC(AAdress, AStartPC, AEndPC);
|
Result := FDbgInfo.FindProcStartEndPC(AAdress, AStartPC, AEndPC);
|
||||||
end;
|
end;
|
||||||
|
@ -767,7 +767,6 @@ type
|
|||||||
AFindSibling: TGetLineAddrFindSibling = fsNone; AFoundLine: PInteger = nil): Boolean; override;
|
AFindSibling: TGetLineAddrFindSibling = fsNone; AFoundLine: PInteger = nil): Boolean; override;
|
||||||
function GetLineAddressMap(const AFileName: String): PDWarfLineMap;
|
function GetLineAddressMap(const AFileName: String): PDWarfLineMap;
|
||||||
function LoadCompilationUnits: Integer;
|
function LoadCompilationUnits: Integer;
|
||||||
function PointerFromRVA(ARVA: QWord): Pointer;
|
|
||||||
function CompilationUnitsCount: Integer; inline;
|
function CompilationUnitsCount: Integer; inline;
|
||||||
property CompilationUnits[AIndex: Integer]: TDwarfCompilationUnit read GetCompilationUnit;
|
property CompilationUnits[AIndex: Integer]: TDwarfCompilationUnit read GetCompilationUnit;
|
||||||
|
|
||||||
@ -3940,11 +3939,6 @@ begin
|
|||||||
TDwarfCompilationUnit(FCompilationUnits[i]).FComputeNameHashesWorker.MarkReadyToRun;
|
TDwarfCompilationUnit(FCompilationUnits[i]).FComputeNameHashesWorker.MarkReadyToRun;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpDwarfInfo.PointerFromRVA(ARVA: QWord): Pointer;
|
|
||||||
begin
|
|
||||||
Result := Pointer(PtrUInt(FImageBase + ARVA));
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TFpDwarfInfo.CompilationUnitsCount: Integer;
|
function TFpDwarfInfo.CompilationUnitsCount: Integer;
|
||||||
begin
|
begin
|
||||||
Result := FCompilationUnits.Count;
|
Result := FCompilationUnits.Count;
|
||||||
|
@ -215,7 +215,6 @@ type
|
|||||||
|
|
||||||
procedure TerminateProcess; override;
|
procedure TerminateProcess; override;
|
||||||
|
|
||||||
function AddrOffset: TDBGPtr; override;
|
|
||||||
function AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
|
function AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
|
||||||
procedure RemoveLib(const AInfo: TUnloadDLLDebugInfo);
|
procedure RemoveLib(const AInfo: TUnloadDLLDebugInfo);
|
||||||
end;
|
end;
|
||||||
@ -1380,11 +1379,6 @@ begin
|
|||||||
FTerminated := True;
|
FTerminated := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDbgWinProcess.AddrOffset: TDBGPtr;
|
|
||||||
begin
|
|
||||||
Result:=0;//inherited AddrOffset - TDbgPtr(FInfo.lpBaseOfImage);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDbgWinProcess.AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
|
function TDbgWinProcess.AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
|
||||||
var
|
var
|
||||||
ID: TDbgPtr;
|
ID: TDbgPtr;
|
||||||
|
Loading…
Reference in New Issue
Block a user