Set the address size based on the target's arch instead
authorJason Molenda <jmolenda@apple.com>
Thu, 8 Dec 2016 02:02:45 +0000 (02:02 +0000)
committerJason Molenda <jmolenda@apple.com>
Thu, 8 Dec 2016 02:02:45 +0000 (02:02 +0000)
of using the address of the all_image_infos struct.
<rdar://problem/29547847>

llvm-svn: 289016

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

index bbaa1ba..9c5f1bc 100644 (file)
@@ -430,9 +430,8 @@ bool DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure() {
   if (m_dyld_all_image_infos_addr != LLDB_INVALID_ADDRESS) {
     ByteOrder byte_order =
         m_process->GetTarget().GetArchitecture().GetByteOrder();
-    uint32_t addr_size = 4;
-    if (m_dyld_all_image_infos_addr > UINT32_MAX)
-      addr_size = 8;
+    uint32_t addr_size =
+        m_process->GetTarget().GetArchitecture().GetAddressByteSize();
 
     uint8_t buf[256];
     DataExtractor data(buf, sizeof(buf), byte_order, addr_size);