<div dir="ltr">I see.  Let me follow up with the breakpad developers to ask them about that.  If you only have to support one endianness the code can be much cleaner.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 16, 2016 at 9:44 AM Dimitar Vlahovski <<a href="mailto:dvlahovski@google.com">dvlahovski@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dvlahovski added inline comments.<br>
<br>
================<br>
Comment at: source/Plugins/Process/minidump/MinidumpTypes.cpp:31-35<br>
@@ +30,7 @@<br>
+    // the signature might be byte swapped<br>
+    data.SetByteOrder(lldb::eByteOrderBig);<br>
+    *offset -= 4;<br>
+    signature = data.GetU32(offset);<br>
+    if (signature == MINIDUMP_SIGNATURE)<br>
+        return true;<br>
+<br>
----------------<br>
zturner wrote:<br>
> Why would this be true?  Is there a minidump specification somewhere that says that both big endian and little endian are valid byte orderings?  I would expect that being a Microsoft created format, it should always be little endian, and if there is a file in big endian we can consider it corrupt.<br>
I didn't find anything in the MS documentation about the minidump's endianess.<br>
I am doing this because breakpad does this too: <a href="https://chromium.googlesource.com/breakpad/breakpad/+/master/src/processor/minidump.cc#4384" rel="noreferrer" target="_blank">https://chromium.googlesource.com/breakpad/breakpad/+/master/src/processor/minidump.cc#4384</a><br>
<br>
<br>
<br>
<a href="https://reviews.llvm.org/D23545" rel="noreferrer" target="_blank">https://reviews.llvm.org/D23545</a><br>
<br>
<br>
<br>
</blockquote></div>