Fix a problem where an SBType was advertising its static type class even though a...
authorEnrico Granata <egranata@apple.com>
Thu, 23 Oct 2014 21:15:20 +0000 (21:15 +0000)
committerEnrico Granata <egranata@apple.com>
Thu, 23 Oct 2014 21:15:20 +0000 (21:15 +0000)
llvm-svn: 220511

lldb/source/API/SBType.cpp
lldb/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py [new file with mode: 0644]
lldb/test/python_api/sbtype_typeclass/main.m [new file with mode: 0644]

index 14835c3..189cf81 100644 (file)
@@ -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;
 }
 
diff --git a/lldb/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py b/lldb/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
new file mode 100644 (file)
index 0000000..a70d2ca
--- /dev/null
@@ -0,0 +1,3 @@
+import lldbinline
+
+lldbinline.MakeInlineTest(__file__, globals())
diff --git a/lldb/test/python_api/sbtype_typeclass/main.m b/lldb/test/python_api/sbtype_typeclass/main.m
new file mode 100644 (file)
index 0000000..599d361
--- /dev/null
@@ -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>
+
+@interface ThisClassTestsThings : NSObject
+@end
+
+@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]);
+}
+@end
+
+
+int main (int argc, char const *argv[])
+{
+    return [[[ThisClassTestsThings alloc] init] doSomething];
+}