FPDebug: deal with on debug loader found

git-svn-id: trunk@43248 -
This commit is contained in:
martin 2013-10-14 11:38:59 +00:00
parent d94a996d71
commit e39906a6d2
2 changed files with 14 additions and 1 deletions

View File

@ -68,6 +68,7 @@ type
constructor Create(AFileHandle: THandle);
{$endif}
destructor Destroy; override;
function IsValid: Boolean;
property ImageBase: QWord read FImageBase; unimplemented;
Property Image64Bit: Boolean read FImage64Bit; unimplemented;
property Section[const AName: String]: PDbgImageSection read GetSection;
@ -81,7 +82,10 @@ implementation
function TDbgImageLoader.GetSection(const AName: String): PDbgImageSection;
begin
Result := FImgReader.Section[AName];
if FImgReader <> nil then
Result := FImgReader.Section[AName]
else
Result := nil;
end;
constructor TDbgImageLoader.Create;
@ -109,5 +113,10 @@ begin
inherited Destroy;
end;
function TDbgImageLoader.IsValid: Boolean;
begin
Result := FImgReader <> nil;
end;
end.

View File

@ -376,6 +376,10 @@ begin
UnLoadDwarf;
debugln(['TFpGDBMIDebugger.LoadDwarf ']);
FImageLoader := TDbgImageLoader.Create(FileName);
if not FImageLoader.IsValid then begin
FreeAndNil(FImageLoader);
exit;
end;;
FDwarfInfo := TDbgDwarf.Create(FImageLoader);
FDwarfInfo.LoadCompilationUnits;
end;