File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
lldb/source/Plugins/SymbolFile/DWARF Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -191,3 +191,10 @@ DWARFDebugInfo::GetDIE(const DIERef &die_ref) {
191
191
return cu->GetNonSkeletonUnit ().GetDIE (die_ref.die_offset ());
192
192
return DWARFDIE (); // Not found
193
193
}
194
+
195
+ llvm::StringRef
196
+ DWARFDebugInfo::PeekDIEName (const DIERef &die_ref) {
197
+ if (DWARFUnit *cu = GetUnit (die_ref))
198
+ return cu->GetNonSkeletonUnit ().PeekDIEName (die_ref.die_offset ());
199
+ return llvm::StringRef ();
200
+ }
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ class DWARFDebugInfo {
43
43
bool ContainsTypeUnits ();
44
44
DWARFDIE GetDIE (const DIERef &die_ref);
45
45
46
+ // / Returns the AT_Name of this DIE, if it exists, without parsing the entire
47
+ // / compile unit. An empty is string is returned upon error or if the
48
+ // / attribute is not present.
49
+ llvm::StringRef PeekDIEName (const DIERef &die_ref);
50
+
46
51
enum {
47
52
eDumpFlag_Verbose = (1 << 0 ), // Verbose dumping
48
53
eDumpFlag_ShowForm = (1 << 1 ), // Show the DW_form type
Original file line number Diff line number Diff line change @@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
663
663
return DWARFDIE (); // Not found
664
664
}
665
665
666
+ llvm::StringRef DWARFUnit::PeekDIEName (dw_offset_t die_offset) {
667
+ const DWARFDataExtractor &data = GetData ();
668
+ DWARFDebugInfoEntry die;
669
+ if (!die.Extract (data, this , &die_offset))
670
+ return llvm::StringRef ();
671
+ return die.GetName (this );
672
+ }
673
+
666
674
DWARFUnit &DWARFUnit::GetNonSkeletonUnit () {
667
675
ExtractUnitDIEIfNeeded ();
668
676
if (m_dwo)
Original file line number Diff line number Diff line change @@ -187,6 +187,11 @@ class DWARFUnit : public UserID {
187
187
188
188
DWARFDIE GetDIE (dw_offset_t die_offset);
189
189
190
+ // / Returns the AT_Name of the DIE at `die_offset`, if it exists, without
191
+ // / parsing the entire compile unit. An empty is string is returned upon
192
+ // / error or if the attribute is not present.
193
+ llvm::StringRef PeekDIEName (dw_offset_t die_offset);
194
+
190
195
DWARFUnit &GetNonSkeletonUnit ();
191
196
192
197
static uint8_t GetAddressByteSize (const DWARFUnit *cu);
You can’t perform that action at this time.
0 commit comments