[Lldb-commits] [lldb] Fix type lookup bug where wrong decl context was being used for a DIE. (PR #94846)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 10 01:17:47 PDT 2024


================
@@ -491,6 +491,18 @@ static void GetTypeLookupContextImpl(DWARFDIE die,
     case DW_TAG_base_type:
       push_ctx(CompilerContextKind::Builtin, name);
       break;
+    // If any of the tags below appear in the parent chain, stop the decl
+    // context and return. Prior to these being in here, if a type existed in a
+    // namespace "a" like "a::my_struct", but we also have a function in that
+    // same namespace "a" which contained a type named "my_struct", both would
+    // return "a::my_struct" as the declaration context since the
+    // DW_TAG_subprogram would be skipped and its parent would be found.
+    case DW_TAG_compile_unit:
----------------
labath wrote:

That's fine. The removal of the early return was unintentional, although (see other comment) I don't think it's totally the right thing to do either.

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


More information about the lldb-commits mailing list