[Lldb-commits] [lldb] r289233 - Fix i386 being able to show member variables correctly by not returning empty objective C types from the runtime.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 9 09:55:00 PST 2016


Author: gclayton
Date: Fri Dec  9 11:54:59 2016
New Revision: 289233

URL: http://llvm.org/viewvc/llvm-project?rev=289233&view=rev
Log:
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.

<rdar://problem/24093343>


Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py?rev=289233&r1=289232&r2=289233&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py Fri Dec  9 11:54:59 2016
@@ -186,6 +186,7 @@ class FoundationTestCase2(TestBase):
                 "be completed."])
         self.runCmd("process continue")
 
+    @expectedFailureAll(archs=["i[3-6]86"], bugnumber="<rdar://problem/28814052>")
     def test_NSError_p(self):
         """Test that p of the result of an unknown method does require a cast."""
         self.build()

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m?rev=289233&r1=289232&r2=289233&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m Fri Dec  9 11:54:59 2016
@@ -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.
   }
 }

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=289233&r1=289232&r2=289233&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Fri Dec  9 11:54:59 2016
@@ -435,8 +435,5 @@ void AppleObjCRuntimeV1::UpdateISAToDesc
 }
 
 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;
 }

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp?rev=289233&r1=289232&r2=289233&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp Fri Dec  9 11:54:59 2016
@@ -249,9 +249,8 @@ clang::QualType AppleObjCTypeEncodingPar
     }
 
     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;




More information about the lldb-commits mailing list