diff options
| author | Enrico Granata <egranata@apple.com> | 2016-05-02 20:58:15 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2016-05-02 20:58:15 +0000 |
| commit | 1dccd9da0187abbc7886ad1d1f682f5904a64717 (patch) | |
| tree | d4f02c4ce038473a272bc2e551461ae3dc6c0f0d /lldb/source/Plugins/LanguageRuntime | |
| parent | 732c4646ee1095a06e3042c683af57ec7dd87004 (diff) | |
| download | bcm5719-llvm-1dccd9da0187abbc7886ad1d1f682f5904a64717.tar.gz bcm5719-llvm-1dccd9da0187abbc7886ad1d1f682f5904a64717.zip | |
Add more debug logging to g_get_shared_cache_class_info_body
llvm-svn: 268303
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime')
| -rw-r--r-- | lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 8c001d08930..ec533926b6b 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -228,7 +228,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr, uint32_t idx = 0; DEBUG_PRINTF ("objc_opt_ro_ptr = %p\n", objc_opt_ro_ptr); DEBUG_PRINTF ("class_infos_ptr = %p\n", class_infos_ptr); - DEBUG_PRINTF ("class_infos_byte_size = %u (%" PRIu64 " class infos)\n", class_infos_byte_size, (size_t)(class_infos_byte_size/sizeof(ClassInfo))); + DEBUG_PRINTF ("class_infos_byte_size = %u (%llu class infos)\n", class_infos_byte_size, (uint64_t)(class_infos_byte_size/sizeof(ClassInfo))); if (objc_opt_ro_ptr) { const objc_opt_t *objc_opt = (objc_opt_t *)objc_opt_ro_ptr; @@ -257,6 +257,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr, else clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt + objc_opt->clsopt_offset); const size_t max_class_infos = class_infos_byte_size/sizeof(ClassInfo); + DEBUG_PRINTF("max_class_infos = %llu\n", (uint64_t)max_class_infos); ClassInfo *class_infos = (ClassInfo *)class_infos_ptr; int32_t invalidEntryOffset = 0; // this is safe to do because the version field order is invariant @@ -268,13 +269,21 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr, DEBUG_PRINTF ("clsopt->capacity = %u\n", clsopt->capacity); DEBUG_PRINTF ("clsopt->mask = 0x%8.8x\n", clsopt->mask); DEBUG_PRINTF ("classOffsets = %p\n", classOffsets); + DEBUG_PRINTF("invalidEntryOffset = %d\n", invalidEntryOffset); for (uint32_t i=0; i<clsopt->capacity; ++i) { const int32_t clsOffset = classOffsets[i].clsOffset; + DEBUG_PRINTF("clsOffset[%u] = %u\n", i, clsOffset); if (clsOffset & 1) + { + DEBUG_PRINTF("clsOffset & 1\n"); continue; // duplicate + } else if (clsOffset == invalidEntryOffset) + { + DEBUG_PRINTF("clsOffset == invalidEntryOffset\n"); continue; // invalid offset + } if (class_infos && idx < max_class_infos) { @@ -288,6 +297,10 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr, h = ((h << 5) + h) + c; class_infos[idx].hash = h; } + else + { + DEBUG_PRINTF("not(class_infos && idx < max_class_infos)\n"); + } ++idx; } |

