[Lldb-commits] [lldb] [lldb] Extend FindTypes to optionally search by mangled type name (PR #113007)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 24 08:38:04 PDT 2024


================
@@ -1032,11 +1032,17 @@ void SymbolFileCTF::FindTypes(const lldb_private::TypeQuery &match,
 
   ConstString name = match.GetTypeBasename();
   for (TypeSP type_sp : GetTypeList().Types()) {
-    if (type_sp && type_sp->GetName() == name) {
-      results.InsertUnique(type_sp);
-      if (results.Done(match))
-        return;
-    }
+    if (!type_sp)
+      continue;
+    auto type_name =
+        match.GetSearchByMangledName()
+            ? type_sp->GetForwardCompilerType().GetMangledTypeName()
+            : type_sp->GetName();
+    if (type_name != name)
+      continue;
+    results.InsertUnique(type_sp);
+    if (results.Done(match))
+      return;
----------------
Michael137 wrote:

Also, do we need to implement this for new lookup option for `CTF` and `PDB`? Given it will probably be always unused (e.g., CTF is only used with `C` IIUC), maybe lets limit this change to just DWARF for now?

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


More information about the lldb-commits mailing list