[Lldb-commits] [lldb] [lldb][DWARF] Search for symbols in all external modules (PR #75927)

via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 19 04:51:17 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

The way this code was updated in dd9587795811ba21e6ca6ad52b4531e17e6babd6 meant that if the first module did not have the symbol, the iteration stopped as returning true means stop. So only if every module had the symbol would we find it, in the last module.

Invert the condition to break when we find the first instance, which is what the previous code did.

---
Full diff: https://github.com/llvm/llvm-project/pull/75927.diff


1 Files Affected:

- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 334876620249fc..a07fa760b1b401 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -175,7 +175,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromClangModule(const SymbolContext &sc,
         *sc.comp_unit, results.GetSearchedSymbolFiles(), [&](Module &module) {
           module.FindTypes(query, results);
           pcm_type_sp = results.GetTypeMap().FirstType();
-          return !pcm_type_sp;
+          return pcm_type_sp != nullptr;
         });
   }
 

``````````

</details>


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


More information about the lldb-commits mailing list