Skip to content

Commit b650764

Browse files
authored
[lldb][test] Add test for completing ObjCObjectType (#95405)
This is a minimal reproducer for a crash where we would try to call `DumpTypeDescription` on an incomplete type. This crash surfaced as part of an NFC refactor of some of the logic in `GetCompleteQualType`: ``` (lldb) expr -l objc -- *(id)0x1234 Stack dump: 0. Program arguments: ./bin/lldb a.out -o "b main" -o run -o "expr -l objc -- *(id)0x1234" Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it): 0 lldb 0x0000000102ec768c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 lldb 0x0000000102ec6010 llvm::sys::RunSignalHandlers() + 112 2 lldb 0x0000000102ec7fa8 SignalHandler(int) + 292 3 libsystem_platform.dylib 0x000000018c7a8c44 _sigtramp + 56 4 LLDB 0x0000000116b2030c lldb_private::TypeSystemClang::DumpTypeDescription(void*, lldb_private::Stream&, lldb::DescriptionLevel, lldb_private::ExecutionContextScope*) + 588 5 LLDB 0x00000001166b5124 lldb_private::CompilerType::DumpTypeDescription(lldb_private::Stream*, lldb::DescriptionLevel, lldb_private::ExecutionContextScope*) const + 228 6 LLDB 0x0000000116d4f08c IRForTarget::CreateResultVariable(llvm::Function&) + 2076 ``` rdar://129633122
1 parent 71f8b44 commit b650764

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int main() { return 0; }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// UNSUPPORTED: system-linux, system-windows
2+
//
3+
// RUN: %clangxx_host %p/Inputs/objc-cast.cpp -g -o %t
4+
// RUN: %lldb %t \
5+
// RUN: -o "b main" -o run -o "expression --language objc -- *(id)0x1" \
6+
// RUN: 2>&1 | FileCheck %s
7+
8+
// CHECK: (lldb) expression --language objc -- *(id)0x1
9+
// CHECK: error: Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory

0 commit comments

Comments
 (0)