[Lldb-commits] [lldb] [lldb] Fix lookup of types in anonymous namespaces with -gsimple-template-names (PR #123054)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 15 08:09:13 PST 2025


================
@@ -401,12 +399,28 @@ static CompilerContext GetContextEntry(DWARFDIE die) {
     return ctx(CompilerContextKind::Typedef);
   case DW_TAG_base_type:
     return ctx(CompilerContextKind::Builtin);
+  case DW_TAG_class_type:
+  case DW_TAG_structure_type:
+  case DW_TAG_union_type: {
+    CompilerContextKind kind = die.Tag() == DW_TAG_union_type
+                                   ? CompilerContextKind::Union
+                                   : CompilerContextKind::ClassOrStruct;
+    llvm::StringRef name = die.GetName();
+    if (!complete_template_names || name.contains('<'))
----------------
labath wrote:

That's part of it -- some names (I'm not sure which ones, but they're probably involve non-type template arguments and things like that) don't have enough information to reconstruct the original name. The other part is that we really don't know whether debug info contains simplified template names or not (even for names that could be simplified). There's no CU-level attribute or anything that would convey that information.

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


More information about the lldb-commits mailing list