2 Commits

Author SHA1 Message Date
Michael Buch
3aea01b271
[lldb][DWARFASTParserClang] RequireCompleteType for ObjC types (#176765)
Currently we forcefully complete C++ types if we can't find their
definition for layout purposes. This ensures that we at least don't
crash in Clang when laying out the type. The definition is required for
types of members/array elements/base classes for the purposes of
calculating their layout. This is also true for Obj-C types, but we
haven't been forcefully completing those.

The test-case that's being un-XFAILed in this patch demonstrates a case
where not completing the super-class forcefully causes a clang crash.

rdar://168440264
2026-01-20 18:26:23 +00:00
Michael Buch
230f6ab1b8 [lldb][test] Add a test for evaluating Obj-C types with an incomplete super-class
LLDB currently crashes when the super-class of an Objective-C type can't
be completed (i.e., has no definition). For Foundation types such as
`NSObject`, the debug-info would usually only contain forward
declarations. The definitions live in the Clang module `.pcm` files. But
if the source of the definition fails to be loaded (e.g., if we just
delete the module cache), then we can no longer guarantee that the
super-class has a definition. This breaks a key Clang invariant, which
requires base-classes to have definitions by the time we try to lay them
out. This patch adds an XFAILed test for such scenario.

rdar://168440264
2026-01-19 14:34:46 +00:00