diff options
author | Enrico Granata <egranata@apple.com> | 2014-10-23 21:15:20 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2014-10-23 21:15:20 +0000 |
commit | 249d639786440747685b00e1a06ed1dcd69d052c (patch) | |
tree | 17bf1abc91cf48ef7327b0d165417bb9fbb8f20b | |
parent | dfbb5cddb430f473040859b147caa0810216f559 (diff) | |
download | bcm5719-llvm-249d639786440747685b00e1a06ed1dcd69d052c.tar.gz bcm5719-llvm-249d639786440747685b00e1a06ed1dcd69d052c.zip |
Fix a problem where an SBType was advertising its static type class even though a dynamic type was available. Solves rdar://18744420
llvm-svn: 220511
-rw-r--r-- | lldb/source/API/SBType.cpp | 2 | ||||
-rw-r--r-- | lldb/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | 3 | ||||
-rw-r--r-- | lldb/test/python_api/sbtype_typeclass/main.m | 34 |
3 files changed, 38 insertions, 1 deletions
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 14835c306a3..189cf81d417 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -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 index 00000000000..a70d2ca7414 --- /dev/null +++ b/lldb/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py @@ -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 index 00000000000..599d36107f4 --- /dev/null +++ b/lldb/test/python_api/sbtype_typeclass/main.m @@ -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]; +} |