================
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
   return DWARFDIE(); // Not found
 }
 
+llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) {
+  const DWARFDataExtractor &data = GetData();
+  DWARFDebugInfoEntry die;
+  if (!die.Extract(data, this, &die_offset))
+    return llvm::StringRef();
+  return die.GetName(this);
+}
----------------
clayborg wrote:

One option here is to check if all of the DIEs have been already parsed in the 
DWARFUnit and if so, grab the existing DIE, and if it hasn't been parsed do 
this. 

This approach doesn't take care of cases where the current DIE doesn't have a 
`DW_AT_name`, but it has a `DW_AT_specification` or `DW_AT_abstract_origin` 
attribute that points to another DIE that does have a name. In this case we 
will get no name back from this function because it doesn't recurse into the 
`DW_AT_specification` or `DW_AT_abstract_origin` die.

https://github.com/llvm/llvm-project/pull/78486
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to