[Lldb-commits] [PATCH] D77327: [lldb] [almost-nfc] 2/2: Introduce DWARF callbacks

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 2 12:28:35 PDT 2020

jankratochvil marked 3 inline comments as done.
jankratochvil added inline comments.

Comment at: lldb/include/lldb/Core/UniqueCStringMap.h:134
+             m_map.begin(), m_map.end(), unique_cstr, Compare())))
+      if (callback(entry.value))
+        return true;
Semantics of the callback is apparent - return `true` if the caller no longer needs any more data. Not sure where to document that, maybe it is simple enough in the code.

Comment at: lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp:68
   DWARFMappedHash::DIEInfoArray hash_data;
-  if (m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data))
-    DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
+  m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data);
+  return DWARFMappedHash::ExtractDIEArray(hash_data, callback);
`DIEInfoArray` is not callback-optimized in this patch. That could be done as an add-on patch.

Comment at: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp:84
+    if (is_implementation != return_implementation_only_if_available)
+      continue;
+    if (return_implementation_only_if_available) {
The meaning of `return_implementation_only_if_available` has changed here. The only caller was using it with `true` so now the only existing caller calls it twice - first with `true` and then with `false` as we can no longer do the original `die_offsets.clear();`.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list