[Lldb-commits] [lldb] r220511 - Fix a problem where an SBType was advertising its static type class even though a dynamic type was available. Solves rdar://18744420
Enrico Granata
egranata at apple.com
Thu Oct 23 14:15:20 PDT 2014
Author: enrico
Date: Thu Oct 23 16:15:20 2014
New Revision: 220511
URL: http://llvm.org/viewvc/llvm-project?rev=220511&view=rev
Log:
Fix a problem where an SBType was advertising its static type class even though a dynamic type was available. Solves rdar://18744420
Added:
lldb/trunk/test/python_api/sbtype_typeclass/
lldb/trunk/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
lldb/trunk/test/python_api/sbtype_typeclass/main.m
Modified:
lldb/trunk/source/API/SBType.cpp
Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=220511&r1=220510&r2=220511&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Thu Oct 23 16:15:20 2014
@@ -477,7 +477,7 @@ lldb::TypeClass
SBType::GetTypeClass ()
{
if (IsValid())
- return m_opaque_sp->GetClangASTType(false).GetTypeClass();
+ return m_opaque_sp->GetClangASTType(true).GetTypeClass();
return lldb::eTypeClassInvalid;
}
Added: lldb/trunk/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py?rev=220511&view=auto
==============================================================================
--- lldb/trunk/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py (added)
+++ lldb/trunk/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py Thu Oct 23 16:15:20 2014
@@ -0,0 +1,3 @@
+import lldbinline
+
+lldbinline.MakeInlineTest(__file__, globals())
Added: lldb/trunk/test/python_api/sbtype_typeclass/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/sbtype_typeclass/main.m?rev=220511&view=auto
==============================================================================
--- lldb/trunk/test/python_api/sbtype_typeclass/main.m (added)
+++ lldb/trunk/test/python_api/sbtype_typeclass/main.m Thu Oct 23 16:15:20 2014
@@ -0,0 +1,34 @@
+//===-- main.m --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#import <Cocoa/Cocoa.h>
+
+ at interface ThisClassTestsThings : NSObject
+ at end
+
+ at implementation ThisClassTestsThings
+- (int)doSomething {
+
+ id s = self;
+ NSLog(@"%@",s); //% s = self.frame().FindVariable("s"); s.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
+ //% s_type = s.GetType()
+ //% typeClass = s_type.GetTypeClass()
+ //% condition = (typeClass == lldb.eTypeClassClass) or (typeClass ==lldb.eTypeClassObjCObject) or (typeClass == lldb.eTypeClassObjCInterface) or (typeClass == lldb.eTypeClassObjCObjectPointer) or (typeClass == lldb.eTypeClassPointer)
+ //% self.assertTrue(condition, "s has the wrong TypeClass")
+ return 0;
+}
+- (id)init {
+ return (self = [super init]);
+}
+ at end
+
+
+int main (int argc, char const *argv[])
+{
+ return [[[ThisClassTestsThings alloc] init] doSomething];
+}
More information about the lldb-commits
mailing list