From 8f618117897e0718aa7950c2e892aa6fdc502ebc Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 9 Dec 2016 17:54:59 +0000 Subject: [PATCH] Fix i386 being able to show member variables correctly by not returning empty objective C types from the runtime. We don't parse ObjC v1 types from the runtime metadata like we do for ObjC v2, but doing so by creating empty types was ruining the i386 v1 debugging experience. llvm-svn: 289233 --- .../lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py | 1 + .../Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m | 8 ++++---- .../LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp | 5 +---- .../ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py index 2322efe..ce7e774 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py +++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py @@ -186,6 +186,7 @@ class FoundationTestCase2(TestBase): "be completed."]) self.runCmd("process continue") + @expectedFailureAll(archs=["i[3-6]86"], bugnumber="") def test_NSError_p(self): """Test that p of the result of an unknown method does require a cast.""" self.build() diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m index 8bf0ec0..f013c56 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m +++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m @@ -25,10 +25,10 @@ int main() ThingSummer *summer = [ThingSummer alloc]; struct things_to_sum tts = { 2, 3, 4 }; int ret = [summer sumThings:tts]; - NSRect rect = {{0, 0}, {10, 20}}; - - // Set breakpoint here. - return rect.origin.x; + // The Objective C V1 runtime won't read types from metadata so we need + // NSValue in our debug info to use it in our test. + NSValue *v = [NSValue valueWithRect:rect]; + return rect.origin.x; // Set breakpoint here. } } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 6bfd7f7..13bd245 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -435,8 +435,5 @@ void AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded() { } DeclVendor *AppleObjCRuntimeV1::GetDeclVendor() { - if (!m_decl_vendor_ap.get()) - m_decl_vendor_ap.reset(new AppleObjCDeclVendor(*this)); - - return m_decl_vendor_ap.get(); + return nullptr; } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp index 16619a7..316115b 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp @@ -249,9 +249,8 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType( } DeclVendor *decl_vendor = m_runtime.GetDeclVendor(); - - assert(decl_vendor); // how are we parsing type encodings for expressions if - // a type vendor isn't in play? + if (!decl_vendor) + return clang::QualType(); const bool append = false; const uint32_t max_matches = 1; -- 2.7.4