[Lldb-commits] [lldb] Add 'FindFirstSymbolWithNameAndType()' to ModuleList. (PR #117777)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 27 01:07:34 PST 2024


================
@@ -524,6 +524,19 @@ void ModuleList::FindGlobalVariables(const RegularExpression &regex,
     module_sp->FindGlobalVariables(regex, max_matches, variable_list);
 }
 
+const Symbol *
+ModuleList::FindFirstSymbolWithNameAndType(ConstString name,
+                                           lldb::SymbolType symbol_type) const {
+  std::lock_guard<std::recursive_mutex> guard(m_modules_mutex);
+  for (const ModuleSP &module_sp : m_modules) {
+    const Symbol *symbol =
+        module_sp->FindFirstSymbolWithNameAndType(name, symbol_type);
+    if (symbol)
+      return symbol;
----------------
Michael137 wrote:

```suggestion
    if (const Symbol *symbol =
        module_sp->FindFirstSymbolWithNameAndType(name, symbol_type))
      return symbol;
```

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


More information about the lldb-commits mailing list