mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 16:31:40 +02:00
FpDebug: Load libraries on Linux, and skip incompatible binaries. Also on Windows, for consistency and stability
This commit is contained in:
parent
baa12a8519
commit
e9f1ffb855
@ -371,6 +371,8 @@ type
|
||||
{ tDbgLinuxLibrary }
|
||||
|
||||
tDbgLinuxLibrary = class(TDbgLibrary)
|
||||
protected
|
||||
procedure InitializeLoaders; override;
|
||||
public
|
||||
constructor Create(const AProcess: TDbgProcess; const AFileName: string; const AModuleHandle: THandle; const ABaseAddr: TDbgPtr);
|
||||
end;
|
||||
@ -390,6 +392,21 @@ end;
|
||||
|
||||
{ tDbgLinuxLibrary }
|
||||
|
||||
procedure tDbgLinuxLibrary.InitializeLoaders;
|
||||
var
|
||||
Loader: TDbgImageLoader;
|
||||
begin
|
||||
Loader := TDbgImageLoader.Create(Name, nil, BaseAddr);
|
||||
// The dynamic-loader (dl) on Linux also loads other stuff then ELF-
|
||||
// formatted libraries.
|
||||
// So it is reasonable likely that the loaded 'library' can not be handled
|
||||
// by the detault readers from the loader.
|
||||
if Loader.IsValid then
|
||||
Loader.AddToLoaderList(LoaderList)
|
||||
else
|
||||
Loader.Free;
|
||||
end;
|
||||
|
||||
constructor tDbgLinuxLibrary.Create(const AProcess: TDbgProcess; const AFileName: string; const AModuleHandle: THandle; const ABaseAddr: TDbgPtr);
|
||||
begin
|
||||
Inherited Create(AProcess, AFileName, AModuleHandle, ABaseAddr);
|
||||
@ -867,8 +884,14 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDbgLinuxProcess.InitializeLoaders;
|
||||
var
|
||||
Loader: TDbgImageLoader;
|
||||
begin
|
||||
TDbgImageLoader.Create(Name).AddToLoaderList(LoaderList);
|
||||
Loader := TDbgImageLoader.Create(Name);
|
||||
if Loader.IsValid then
|
||||
Loader.AddToLoaderList(LoaderList)
|
||||
else
|
||||
Loader.Free;
|
||||
end;
|
||||
|
||||
function TDbgLinuxProcess.CreateThread(AthreadIdentifier: THandle; out IsMainThread: boolean): TDbgThread;
|
||||
|
@ -478,8 +478,14 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDbgWinProcess.InitializeLoaders;
|
||||
var
|
||||
Loader: TDbgImageLoader;
|
||||
begin
|
||||
TDbgImageLoader.Create(FInfo.hFile).AddToLoaderList(LoaderList);
|
||||
Loader := TDbgImageLoader.Create(FInfo.hFile);
|
||||
if Loader.IsValid then
|
||||
AddToLoaderList(LoaderList)
|
||||
else
|
||||
Loader.Free;
|
||||
end;
|
||||
|
||||
function TDbgWinProcess.CreateWatchPointData: TFpWatchPointData;
|
||||
|
Loading…
Reference in New Issue
Block a user