mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 01:19:45 +02:00
FPDebug: scan class parents
git-svn-id: trunk@43399 -
This commit is contained in:
parent
6770c13d81
commit
26b8234ad0
@ -1398,11 +1398,13 @@ end;
|
||||
function TDbgDwarfInfoAddressContext.FindSymbol(const AName: String): TDbgSymbol;
|
||||
var
|
||||
SubRoutine: TDbgDwarfProcSymbol; // TDbgSymbol;
|
||||
CU, CU2: TDwarfCompilationUnit;
|
||||
CU, CU2, FwdCompUint: TDwarfCompilationUnit;
|
||||
//Scope,
|
||||
StartScopeIdx, ExtVal, i: Integer;
|
||||
InfoEntry: TDwarfInformationEntry;
|
||||
InfoEntry, InfoEntryTmp, InfoEntryParent: TDwarfInformationEntry;
|
||||
s, InfoName: String;
|
||||
FwdInfoPtr: Pointer;
|
||||
tg: Cardinal;
|
||||
begin
|
||||
Result := nil;
|
||||
if (FSymbol = nil) or not(FSymbol is TDbgDwarfProcSymbol) then
|
||||
@ -1429,12 +1431,35 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
tg := InfoEntry.Abbrev.tag;
|
||||
|
||||
if InfoEntry.GoNamedChildEx(AName) then begin
|
||||
Result := TDbgDwarfIdentifier.CreateSubClass(AName, InfoEntry);
|
||||
DebugLn(FPDBG_DWARF_SEARCH, ['TDbgDwarf.FindIdentifier found ', dbgs(InfoEntry.FScope, CU), DbgSName(Result)]);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if (tg = DW_TAG_class_type) or (tg = DW_TAG_structure_type) then begin
|
||||
// search parent class
|
||||
InfoEntry.ScopeIndex := StartScopeIdx;
|
||||
InfoEntryParent := InfoEntry.FindChildByTag(DW_TAG_inheritance);
|
||||
while (InfoEntryParent <> nil) and (InfoEntryParent.ReadReference(DW_AT_type, FwdInfoPtr, FwdCompUint)) do begin
|
||||
InfoEntryParent.ReleaseReference;
|
||||
InfoEntryParent := TDwarfInformationEntry.Create(FwdCompUint, FwdInfoPtr);
|
||||
DebugLn(FPDBG_DWARF_SEARCH, ['TDbgDwarf.FindIdentifier PARENT ', dbgs(InfoEntryParent, FwdCompUint) ]);
|
||||
if InfoEntryParent.GoNamedChildEx(AName) then begin
|
||||
Result := TDbgDwarfIdentifier.CreateSubClass(AName, InfoEntryParent);
|
||||
InfoEntryParent.ReleaseReference;
|
||||
DebugLn(FPDBG_DWARF_SEARCH, ['TDbgDwarf.FindIdentifier found ', dbgs(InfoEntryParent.FScope, CU), DbgSName(Result)]);
|
||||
exit;
|
||||
end;
|
||||
InfoEntryTmp := InfoEntryParent.FindChildByTag(DW_TAG_inheritance);
|
||||
InfoEntryParent.ReleaseReference;
|
||||
InfoEntryParent := InfoEntryTmp;
|
||||
end;
|
||||
InfoEntryParent.ReleaseReference;
|
||||
end;
|
||||
|
||||
// Search parent(s)
|
||||
InfoEntry.ScopeIndex := StartScopeIdx;
|
||||
InfoEntry.GoParent;
|
||||
|
Loading…
Reference in New Issue
Block a user