[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 17 16:45:05 PST 2024


================
@@ -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:

I am not saying that this works needs to be done, just pointing out that this might not be as efficient as you want it to be and might cause all DIEs to be parsed. 

https://github.com/llvm/llvm-project/pull/78486


More information about the lldb-commits mailing list