[Lldb-commits] [lldb] [lldb] Better matching of types in anonymous namespaces (PR #102111)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 7 10:23:41 PDT 2024


================
@@ -788,7 +808,13 @@ Type::GetTypeScopeAndBasename(llvm::StringRef name) {
     switch (pos.value()) {
     case ':':
       if (prev_is_colon && template_depth == 0) {
-        result.scope.push_back(name.slice(name_begin, pos.index() - 1));
+        llvm::StringRef scope_name = name.slice(name_begin, pos.index() - 1);
+        // The itanium demangler uses this string to represent anonymous
+        // namespaces. Convert it to a more language-agnostic form (which is
+        // also used in DWARF).
+        if (scope_name == "(anonymous namespace)")
+          scope_name = "";
----------------
clayborg wrote:

So we can catch this here and NULL out the name, but what is the user wants to find something in an anonymous namespace with `type lookup "(anonymous namespace)::A"`. Do we clear the name there as well?

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


More information about the lldb-commits mailing list