[Lldb-commits] [lldb] r127841 - in /lldb/trunk: include/lldb/Core/ValueObject.h source/Core/ValueObject.cpp source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
Jim Ingham
jingham at apple.com
Thu Mar 17 17:05:19 PDT 2011
Author: jingham
Date: Thu Mar 17 19:05:18 2011
New Revision: 127841
URL: http://llvm.org/viewvc/llvm-project?rev=127841&view=rev
Log:
Relax the constraint on the types of ValueObjects that we'll by default try the
ObjC runtime for print object to Pointer AND Integer (from just pointer.)
Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=127841&r1=127840&r2=127841&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Mar 17 19:05:18 2011
@@ -93,6 +93,9 @@
return false;
}
+ bool
+ IsIntegerType (bool &is_signed);
+
virtual bool
GetBaseClassPath (Stream &s);
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=127841&r1=127840&r2=127841&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Mar 17 19:05:18 2011
@@ -588,13 +588,16 @@
if (runtime == NULL)
{
- // Aw, hell, if the things a pointer, let's try ObjC anyway...
+ // Aw, hell, if the things a pointer, or even just an integer, let's try ObjC anyway...
clang_type_t opaque_qual_type = GetClangType();
if (opaque_qual_type != NULL)
{
- clang::QualType qual_type (clang::QualType::getFromOpaquePtr(opaque_qual_type).getNonReferenceType());
- if (qual_type->isAnyPointerType())
+ bool is_signed;
+ if (ClangASTContext::IsIntegerType (opaque_qual_type, is_signed)
+ || ClangASTContext::IsPointerType (opaque_qual_type))
+ {
runtime = process->GetLanguageRuntime(lldb::eLanguageTypeObjC);
+ }
}
}
@@ -892,7 +895,11 @@
return ClangASTContext::IsPointerType (GetClangType());
}
-
+bool
+ValueObject::IsIntegerType (bool &is_signed)
+{
+ return ClangASTContext::IsIntegerType (GetClangType(), is_signed);
+}
bool
ValueObject::IsPointerOrReferenceType ()
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=127841&r1=127840&r2=127841&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Thu Mar 17 19:05:18 2011
@@ -41,9 +41,11 @@
bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &object, ExecutionContextScope *exe_scope)
{
-
- // ObjC objects can only be pointers:
- if (!object.IsPointerType())
+ bool is_signed;
+ // ObjC objects can only be pointers, but we extend this to integer types because an expression might just
+ // result in an address, and we should try that to see if the address is an ObjC object.
+
+ if (!(object.IsPointerType() || object.IsIntegerType(is_signed)))
return NULL;
// Make the argument list: we pass one arg, the address of our pointer, to the print function.
More information about the lldb-commits
mailing list