mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Fix r357749 for big-endian architectures
We need to read the strings from the minidump files as little-endian, regardless of the host byte order. I definitely remember thinking about this case while writing the patch (and in fact, I have implemented that for the "write" case), but somehow I have ended up not implementing the byte swapping when reading the data. This adds the necessary byte-swapping and should hopefully fix test failures on big-endian bots. llvm-svn: 357754
This commit is contained in:
parent
c1867a3576
commit
b02c33c0c2
@ -38,12 +38,16 @@ Expected<std::string> MinidumpFile::getString(size_t Offset) const {
|
||||
return "";
|
||||
|
||||
Offset += sizeof(support::ulittle32_t);
|
||||
auto ExpectedData = getDataSliceAs<UTF16>(getData(), Offset, Size);
|
||||
auto ExpectedData =
|
||||
getDataSliceAs<support::ulittle16_t>(getData(), Offset, Size);
|
||||
if (!ExpectedData)
|
||||
return ExpectedData.takeError();
|
||||
|
||||
SmallVector<UTF16, 32> WStr(Size);
|
||||
copy(*ExpectedData, WStr.begin());
|
||||
|
||||
std::string Result;
|
||||
if (!convertUTF16ToUTF8String(*ExpectedData, Result))
|
||||
if (!convertUTF16ToUTF8String(WStr, Result))
|
||||
return createError("String decoding failed");
|
||||
|
||||
return Result;
|
||||
|
Loading…
Reference in New Issue
Block a user