mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 19:00:58 +02:00
FpDebugger (pure): Patch from Colin Western to resolve relative filenames in Dwarf-debug info.
git-svn-id: trunk@45933 -
This commit is contained in:
parent
f7d6fb47ee
commit
ac95b9c55d
@ -474,6 +474,7 @@ type
|
|||||||
|
|
||||||
FInfoData: Pointer;
|
FInfoData: Pointer;
|
||||||
FFileName: String;
|
FFileName: String;
|
||||||
|
FCompDir: String;
|
||||||
FUnitName: String;
|
FUnitName: String;
|
||||||
FIdentifierCase: Integer;
|
FIdentifierCase: Integer;
|
||||||
FProducer: String;
|
FProducer: String;
|
||||||
@ -538,6 +539,7 @@ type
|
|||||||
function GetLineAddressMap(const AFileName: String): PDWarfLineMap;
|
function GetLineAddressMap(const AFileName: String): PDWarfLineMap;
|
||||||
function GetLineAddress(const AFileName: String; ALine: Cardinal): TDbgPtr;
|
function GetLineAddress(const AFileName: String; ALine: Cardinal): TDbgPtr;
|
||||||
procedure BuildLineInfo(AAddressInfo: PDwarfAddressInfo; ADoAll: Boolean);
|
procedure BuildLineInfo(AAddressInfo: PDwarfAddressInfo; ADoAll: Boolean);
|
||||||
|
function FullFileName(const AFileName:string): String;
|
||||||
|
|
||||||
property Valid: Boolean read FValid;
|
property Valid: Boolean read FValid;
|
||||||
property FileName: String read FFileName;
|
property FileName: String read FFileName;
|
||||||
@ -3246,7 +3248,7 @@ end;
|
|||||||
procedure TDwarfLineInfoStateMachine.SetFileName(AIndex: Cardinal);
|
procedure TDwarfLineInfoStateMachine.SetFileName(AIndex: Cardinal);
|
||||||
begin
|
begin
|
||||||
if (Aindex > 0) and (AIndex <= FOwner.FLineInfo.FileNames.Count)
|
if (Aindex > 0) and (AIndex <= FOwner.FLineInfo.FileNames.Count)
|
||||||
then FFileName := FOwner.FLineInfo.FileNames[AIndex - 1]
|
then FFileName := FOwner.FullFileName(FOwner.FLineInfo.FileNames[AIndex - 1])
|
||||||
else FFileName := Format('Unknown fileindex(%u)', [AIndex]);
|
else FFileName := Format('Unknown fileindex(%u)', [AIndex]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3361,6 +3363,13 @@ begin
|
|||||||
Result := FAddressMap;
|
Result := FAddressMap;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDwarfCompilationUnit.FullFileName(const AFileName: String): String;
|
||||||
|
begin
|
||||||
|
Result := AFileName;
|
||||||
|
if FCompDir = '' then exit;
|
||||||
|
Result := LazFileUtils.ResolveDots(FCompDir+AFileName);
|
||||||
|
end;
|
||||||
|
|
||||||
function TDwarfCompilationUnit.GetUnitName: String;
|
function TDwarfCompilationUnit.GetUnitName: String;
|
||||||
begin
|
begin
|
||||||
Result := FUnitName;
|
Result := FUnitName;
|
||||||
@ -3604,6 +3613,9 @@ begin
|
|||||||
if LocateAttribute(Scope.Entry, DW_AT_name, AttribList, Attrib, Form)
|
if LocateAttribute(Scope.Entry, DW_AT_name, AttribList, Attrib, Form)
|
||||||
then ReadValue(Attrib, Form, FFileName);
|
then ReadValue(Attrib, Form, FFileName);
|
||||||
|
|
||||||
|
if LocateAttribute(Scope.Entry, DW_AT_comp_dir, AttribList, Attrib, Form)
|
||||||
|
then ReadValue(Attrib, Form, FCompDir);
|
||||||
|
|
||||||
if LocateAttribute(Scope.Entry, DW_AT_producer, AttribList, Attrib, Form)
|
if LocateAttribute(Scope.Entry, DW_AT_producer, AttribList, Attrib, Form)
|
||||||
then ReadValue(Attrib, Form, FProducer);
|
then ReadValue(Attrib, Form, FProducer);
|
||||||
|
|
||||||
|
@ -1614,7 +1614,7 @@ begin
|
|||||||
if sym = nil then
|
if sym = nil then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
result.SrcFile := sym.FileName;
|
result.SrcFile := ExtractFileName(sym.FileName);
|
||||||
result.SrcLine := sym.Line;
|
result.SrcLine := sym.Line;
|
||||||
result.SrcFullName := sym.FileName;
|
result.SrcFullName := sym.FileName;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user