This is an archive of the discontinued LLVM Phabricator instance.

[Compiler-rt][MSan] Fix msan_print_shadow3.cc test for Big Endian archs
ClosedPublic

Authored by mohit.bhakkad on Feb 15 2016, 5:08 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mohit.bhakkad retitled this revision from to [Compiler-rt][MSan] Fix msan_print_shadow3.cc test for Big Endian archs.
mohit.bhakkad updated this object.
mohit.bhakkad added reviewers: eugenis, kcc, samsonov.
mohit.bhakkad set the repository for this revision to rL LLVM.
eugenis edited edge metadata.Feb 16 2016, 11:24 AM

maybe just define x_s as an array of char?

mohit.bhakkad added a comment.EditedFeb 17 2016, 11:10 PM

maybe just define x_s as an array of char?

Even after that we will have differences, as shadow is printed in hex format(i.e. each nibble)
so "12" will be printed as "21", "78" as "87" etc.

And it is because we are reversing it on the basis of endianness in DescribeMemoryRange()

Ah, right. LGTM.
Btw, is that consistent with how other tools print memory on big endian platforms? Like gdb and objdump. If not, this can be changed.

eugenis accepted this revision.Feb 18 2016, 8:28 AM
eugenis edited edge metadata.
This revision is now accepted and ready to land.Feb 18 2016, 8:28 AM

Btw, is that consistent with how other tools print memory on big endian platforms? Like gdb and objdump. If not, this can be changed.

No, in gdb, endians are differentiated from byte level, so nibbles are not reversed while displaying.

@eugenis, I think we should remove changes in rL210335 and use char array in this test.

Hm, r210335 looks weird. So, the way you suggest is to print the hex digits of each byte in the most significant first order, and print different bytes in the memory order. Sounds reasonable, let's do it.

mohit.bhakkad edited edge metadata.

I have removed endian based conditions for shadow printing in D17563.
This revision uses a char array to make this test compatible for both endians.

mohit.bhakkad requested a review of this revision.Feb 25 2016, 10:26 PM
mohit.bhakkad edited edge metadata.
eugenis accepted this revision.Feb 25 2016, 10:29 PM
eugenis edited edge metadata.

LGTM together with D17563.

This revision is now accepted and ready to land.Feb 25 2016, 10:29 PM