summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp38
-rw-r--r--lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp4
3 files changed, 44 insertions, 0 deletions
diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
index 963221adb4a..bce023bfd61 100644
--- a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
+++ b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
@@ -432,6 +432,44 @@ CFCMutableDictionary::SetValueUInt64(CFStringRef key, uint64_t value, bool can_c
}
bool
+CFCMutableDictionary::AddValueDouble(CFStringRef key, double value, bool can_create)
+{
+ CFMutableDictionaryRef dict = Dictionary(can_create);
+ if (dict != NULL)
+ {
+ // The number may appear negative if the MSBit is set in "value". Due to a limitation of
+ // CFNumber, there isn't a way to have it show up otherwise as of this writing.
+ CFCReleaser<CFNumberRef> cf_number(::CFNumberCreate (kCFAllocatorDefault, kCFNumberDoubleType, &value));
+ if (cf_number.get())
+ {
+ // Let the dictionary own the CFNumber
+ ::CFDictionaryAddValue (dict, key, cf_number.get());
+ return true;
+ }
+ }
+ return false;
+}
+
+bool
+CFCMutableDictionary::SetValueDouble(CFStringRef key, double value, bool can_create)
+{
+ CFMutableDictionaryRef dict = Dictionary(can_create);
+ if (dict != NULL)
+ {
+ // The number may appear negative if the MSBit is set in "value". Due to a limitation of
+ // CFNumber, there isn't a way to have it show up otherwise as of this writing.
+ CFCReleaser<CFNumberRef> cf_number(::CFNumberCreate (kCFAllocatorDefault, kCFNumberDoubleType, &value));
+ if (cf_number.get())
+ {
+ // Let the dictionary own the CFNumber
+ ::CFDictionarySetValue (dict, key, cf_number.get());
+ return true;
+ }
+ }
+ return false;
+}
+
+bool
CFCMutableDictionary::AddValueCString(CFStringRef key, const char *cstr, bool can_create)
{
CFMutableDictionaryRef dict = Dictionary(can_create);
diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h
index de32ead3103..a1cfb68f569 100644
--- a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h
+++ b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h
@@ -53,6 +53,8 @@ public:
bool SetValueUInt32(CFStringRef key, uint32_t value, bool can_create = false);
bool AddValueUInt64(CFStringRef key, uint64_t value, bool can_create = false);
bool SetValueUInt64(CFStringRef key, uint64_t value, bool can_create = false);
+ bool AddValueDouble(CFStringRef key, double value, bool can_create = false);
+ bool SetValueDouble(CFStringRef key, double value, bool can_create = false);
bool AddValueCString(CFStringRef key, const char *cstr, bool can_create = false);
bool SetValueCString(CFStringRef key, const char *cstr, bool can_create = false);
void RemoveValue(const void *value);
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 37bdacdd3aa..ae1eca83d60 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -1849,6 +1849,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table
{
// The result is the number of ClassInfo structures that were filled in
uint32_t num_class_infos = return_value.GetScalar().ULong();
+ if (log)
+ log->Printf("Discovered %u ObjC classes\n",num_class_infos);
if (num_class_infos > 0)
{
// Read the ClassInfo structures
@@ -2099,6 +2101,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache()
{
// The result is the number of ClassInfo structures that were filled in
uint32_t num_class_infos = return_value.GetScalar().ULong();
+ if (log)
+ log->Printf("Discovered %u ObjC classes in shared cache\n",num_class_infos);
if (num_class_infos > 0)
{
// Read the ClassInfo structures
OpenPOWER on IntegriCloud