https://github.com/robk-dev updated 
https://github.com/llvm/llvm-project/pull/216711

>From bdab2b12e0be455ec425e58c43c1f6c9158219a1 Mon Sep 17 00:00:00 2001
From: Rob <[email protected]>
Date: Wed, 12 Aug 2026 23:37:16 +0100
Subject: [PATCH] [lldb] Guard MS inheritance model against non-CXXRecordDecl
 DWARF types

CompleteRecordType() computes the MSInheritanceAttr for the Microsoft
C++ ABI by calling calculateInheritanceModel() on the record's
CXXRecordDecl. Objective-C interface types complete through the same
path but are ObjCInterfaceDecls, so GetAsCXXRecordDecl() returns null
and the Microsoft-ABI block crashed on every Objective-C type
completion for *-windows-msvc targets. Guard it the same way as the
SetRecordLayout call above.

Found debugging GNUstep Objective-C programs on Windows, where any
`frame variable` touching an object type crashed LLDB.

Assisted-by: Claude Fable 5
---
 .../Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index b60f1d9e41958..8609e0b2b0388 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2239,8 +2239,14 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
 
   clang::CXXRecordDecl *record_decl =
       m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
-  if (record_decl)
-    GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
+  // Objective-C interfaces are completed through this path as well, but are
+  // not CXXRecordDecls. Nothing that follows applies to them: they have no
+  // record layout to hand to the importer, no pointer-to-member
+  // representation to infer, and no nested types to resolve.
+  if (!record_decl)
+    return clang_type.IsValid();
+
+  GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
 
   // DWARF doesn't have the attribute, but we can infer the value the same way
   // as Clang Sema does. It's required to calculate the size of pointers to

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to