[Lldb-commits] [PATCH] D58985: Fix core files for 32 bit architectures that are supported in ProcessELFCore.cpp

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 5 11:20:19 PST 2019


zturner added inline comments.


================
Comment at: source/Plugins/Process/elf-core/ThreadElfCore.cpp:276
+    else
+      return sizeof(ELFLinuxPrStatus) - 10 * 4;
   }
----------------
subtracting 40 from the header size seems a bit magical to those not in the know (such as myself).  Could you do something like:

```
if (arch.GetAddressByteSize() == 8)
    return sizeof(ELFLinuxPrStatus);

lldbassert(arch.GetAddressByteSize() == 4);
constexpr int kWhatever = 10;
return sizeof(ELFLinuxPrStatus) - kWhatever * arch.GetAddressByteSize();
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58985/new/

https://reviews.llvm.org/D58985





More information about the lldb-commits mailing list