static const ConstString g_DictionaryM("__NSDictionaryM");
static const ConstString g_DictionaryMLegacy("__NSDictionaryM_Legacy");
static const ConstString g_DictionaryMImmutable("__NSDictionaryM_Immutable");
+ static const ConstString g_DictionaryMFrozen("__NSFrozenDictionaryM");
static const ConstString g_Dictionary1("__NSSingleEntryDictionaryI");
static const ConstString g_Dictionary0("__NSDictionary0");
static const ConstString g_DictionaryCF("__CFDictionary");
return false;
value &= (is_64bit ? ~0xFC00000000000000UL : ~0xFC000000U);
- } else if (class_name == g_DictionaryM || class_name == g_DictionaryMLegacy) {
+ } else if (class_name == g_DictionaryM || class_name == g_DictionaryMLegacy
+ || class_name == g_DictionaryMFrozen) {
AppleObjCRuntime *apple_runtime =
llvm::dyn_cast_or_null<AppleObjCRuntime>(runtime);
Status error;
static const ConstString g_DictionaryM("__NSDictionaryM");
static const ConstString g_Dictionary1("__NSSingleEntryDictionaryI");
static const ConstString g_DictionaryImmutable("__NSDictionaryM_Immutable");
+ static const ConstString g_DictionaryMFrozen("__NSFrozenDictionaryM");
static const ConstString g_DictionaryMLegacy("__NSDictionaryM_Legacy");
static const ConstString g_Dictionary0("__NSDictionary0");
static const ConstString g_DictionaryCF("__CFDictionary");
if (class_name == g_DictionaryI) {
return (new NSDictionaryISyntheticFrontEnd(valobj_sp));
- } else if (class_name == g_DictionaryM) {
+ } else if (class_name == g_DictionaryM || class_name == g_DictionaryMFrozen) {
if (runtime->GetFoundationVersion() >= 1437) {
return (new Foundation1437::NSDictionaryMSyntheticFrontEnd(valobj_sp));
} else if (runtime->GetFoundationVersion() >= 1428) {
def nscontainers_data_formatter_commands(self):
self.expect(
- 'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary newMutableDictionaryRef cfarray_ref mutable_array_ref',
+ 'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary copyDictionary newMutableDictionaryRef cfarray_ref mutable_array_ref',
substrs=[
'(NSArray *) newArray = ',
' @"50 elements"',
' 2 key/value pairs',
'(NSDictionary *) newMutableDictionary = ',
' 21 key/value pairs',
+ '(NSMutableDictionary *) copyDictionary = ',
+ ' 21 key/value pairs',
'(CFMutableDictionaryRef) newMutableDictionaryRef = ',
' 21 key/value pairs',
'(CFArrayRef) cfarray_ref = ',
' @"11 elements"',
])
+ self.expect('frame var -d run-target copyDictionary[10]',
+ substrs=['@"bar9"', '@"foo"'])
+
self.expect(
'frame variable -d run-target *nscfDictionary',
patterns=[
[newMutableDictionary setObject:@"foo" forKey:@"bar19"];
[newMutableDictionary setObject:@"foo" forKey:@"bar20"];
+ /* Copying an NSMutableDictionary makes a different member of the
+ class cluster, so let's also make a copy of this one: */
+ NSMutableDictionary *copyDictionary = [newMutableDictionary copy];
+
CFMutableDictionaryRef newMutableDictionaryRef = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, newMutableDictionary);
id cfKeys[4] = {@"foo", @"bar", @"baz", @"quux"};