summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/ValueObject.h3
-rw-r--r--lldb/source/Core/ValueObject.cpp15
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp8
3 files changed, 19 insertions, 7 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 30e5d5741c7..9a1a281a7a6 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -93,6 +93,9 @@ public:
return false;
}
+ bool
+ IsIntegerType (bool &is_signed);
+
virtual bool
GetBaseClassPath (Stream &s);
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 95669255bd5..9346db4280c 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -588,13 +588,16 @@ ValueObject::GetObjectDescription (ExecutionContextScope *exe_scope)
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 @@ ValueObject::IsPointerType ()
return ClangASTContext::IsPointerType (GetClangType());
}
-
+bool
+ValueObject::IsIntegerType (bool &is_signed)
+{
+ return ClangASTContext::IsIntegerType (GetClangType(), is_signed);
+}
bool
ValueObject::IsPointerOrReferenceType ()
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 8966ec0a82a..11880642182 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -41,9 +41,11 @@ using namespace lldb_private;
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.
OpenPOWER on IntegriCloud