Skip to content

Commit 5abf50c

Browse files
committed
Address user feedback.
- Make GetDIERefSymbolFile() virtual in SymbolFileDWARF and override in SymbolFileDWARFDwo - Rename IsForeignTypeUnit to GetForeignTypeUnit
1 parent a896cba commit 5abf50c

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ DebugNamesDWARFIndex::GetUnits(const DebugNames &debug_names) {
6161
}
6262

6363
std::optional<DWARFTypeUnit *>
64-
DebugNamesDWARFIndex::IsForeignTypeUnit(const DebugNames::Entry &entry) const {
64+
DebugNamesDWARFIndex::GetForeignTypeUnit(const DebugNames::Entry &entry) const {
6565
std::optional<uint64_t> type_sig = entry.getForeignTUTypeSignature();
6666
if (!type_sig.has_value())
6767
return std::nullopt;
@@ -120,7 +120,7 @@ DebugNamesDWARFIndex::IsForeignTypeUnit(const DebugNames::Entry &entry) const {
120120
DWARFUnit *
121121
DebugNamesDWARFIndex::GetNonSkeletonUnit(const DebugNames::Entry &entry) const {
122122

123-
if (std::optional<DWARFTypeUnit *> foreign_tu = IsForeignTypeUnit(entry))
123+
if (std::optional<DWARFTypeUnit *> foreign_tu = GetForeignTypeUnit(entry))
124124
return foreign_tu.value();
125125

126126
// Look for a DWARF unit offset (CU offset or local TU offset) as they are
@@ -349,7 +349,7 @@ void DebugNamesDWARFIndex::GetFullyQualifiedType(
349349
// If we get a NULL foreign_tu back, the entry doesn't match the type unit
350350
// in the .dwp file, or we were not able to load the .dwo file or the DWO ID
351351
// didn't match.
352-
std::optional<DWARFTypeUnit *> foreign_tu = IsForeignTypeUnit(entry);
352+
std::optional<DWARFTypeUnit *> foreign_tu = GetForeignTypeUnit(entry);
353353
if (foreign_tu && foreign_tu.value() == nullptr)
354354
continue;
355355

lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class DebugNamesDWARFIndex : public DWARFIndex {
109109
/// doesn't match the originating skeleton compile unit's entry
110110
/// Returns std::nullopt if this entry is not a foreign type unit entry.
111111
std::optional<DWARFTypeUnit *>
112-
IsForeignTypeUnit(const DebugNames::Entry &entry) const;
112+
GetForeignTypeUnit(const DebugNames::Entry &entry) const;
113113

114114
bool ProcessEntry(const DebugNames::Entry &entry,
115115
llvm::function_ref<bool(DWARFDIE die)> callback);

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ SymbolFileDWARF *SymbolFileDWARF::GetDIERefSymbolFile(const DIERef &die_ref) {
17481748
// to let the base symbol file handle this.
17491749
SymbolFileDWARFDwo *dwo = llvm::dyn_cast_or_null<SymbolFileDWARFDwo>(this);
17501750
if (dwo)
1751-
return dwo->GetBaseSymbolFile().GetDIERefSymbolFile(die_ref);
1751+
return dwo->GetDIERefSymbolFile(die_ref);
17521752

17531753
if (file_index) {
17541754
SymbolFileDWARFDebugMap *debug_map = GetDebugMapSymfile();

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class SymbolFileDWARF : public SymbolFileCommon {
248248
/// Calling this function will find the correct symbol file to use so that
249249
/// further lookups can be done on the correct symbol file so that the DIE
250250
/// offset makes sense in the DIERef.
251-
SymbolFileDWARF *GetDIERefSymbolFile(const DIERef &die_ref);
251+
virtual SymbolFileDWARF *GetDIERefSymbolFile(const DIERef &die_ref);
252252

253253
virtual DWARFDIE GetDIE(const DIERef &die_ref);
254254

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,8 @@ bool SymbolFileDWARFDwo::GetDebugInfoHadFrameVariableErrors() const {
174174
void SymbolFileDWARFDwo::SetDebugInfoHadFrameVariableErrors() {
175175
return GetBaseSymbolFile().SetDebugInfoHadFrameVariableErrors();
176176
}
177+
178+
SymbolFileDWARF *
179+
SymbolFileDWARFDwo::GetDIERefSymbolFile(const DIERef &die_ref) {
180+
return GetBaseSymbolFile().GetDIERefSymbolFile(die_ref);
181+
}

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
6767
bool GetDebugInfoHadFrameVariableErrors() const override;
6868
void SetDebugInfoHadFrameVariableErrors() override;
6969

70+
SymbolFileDWARF *GetDIERefSymbolFile(const DIERef &die_ref) override;
71+
7072
protected:
7173
DIEToTypePtr &GetDIEToType() override;
7274

0 commit comments

Comments
 (0)