[Lldb-commits] [lldb] [lldb][test] Add test-coverage for DW_AT_APPLE_objc_complete_type parsing (PR #120279)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 18 01:17:01 PST 2024
================
@@ -0,0 +1,63 @@
+# Tests that LLDB correctly finds the implementation
+# DIE (with a `DW_AT_APPLE_objc_complete_type`)
+# given an interface DIE (without said attribute).
+#
+# RUN: split-file %s %t
+# RUN: %clangxx_host %t/lib.m -c -g -o %t/lib.o
+# RUN: %clangxx_host %t/main.m -c -g -o %t/main.o
+# RUN: %clangxx_host %t/main.o %t/lib.o -o %t/a.out -framework Foundation
----------------
labath wrote:
I think this needs a `REQUIRES: system-darwin`.
For science, I also tried to make a version of this test which could run on other systems, but all I managed is to hit an (lldb)assert:
```
$ cat a.m
__attribute__((objc_root_class)) @interface Foo {
int y;
}
@end
#ifdef DEF
@implementation Foo {
int i;
}
- (id)init {
self->i = 1;
self->y = 2;
return self;
}
@end
#endif
Foo *foo;
$ clang -c a.m -g -DDEF --target=aarch64-apple-macosx
$ lldb a.o -o "target variable foo[0]"
(lldb) target create "a.o"
Current executable set to '/tmp/a.o' (arm64).
(lldb) target variable foo[0]
warning: trying to determine the size of type @interface Foo{
int y;
int i;
}
@end
without a valid ExecutionContext. this is not reliable. please file a bug against LLDB.
backtrace:
#0 0x00007f117b0ab29e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm/lib/Support/Unix/Signals.inc:723:22
#1 0x00007f117af11e90 lldb_private::TypeSystemClang::GetObjCBitSize(clang::QualType, lldb_private::ExecutionContextScope*) lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4780:17
```
https://github.com/llvm/llvm-project/pull/120279
More information about the lldb-commits
mailing list