From: Enrico Granata Date: Thu, 23 Oct 2014 21:15:20 +0000 (+0000) Subject: Fix a problem where an SBType was advertising its static type class even though a... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=249d639786440747685b00e1a06ed1dcd69d052c;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 14835c3..189cf81 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 0000000..a70d2ca --- /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 0000000..599d361 --- /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 + +@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]; +}