Fix small sized argument output with tracing enabled (mono/mono#16841)
authorCalvin Buckley <calvin@cmpct.info>
Sun, 15 Sep 2019 15:50:32 +0000 (12:50 -0300)
committerZoltan Varga <vargaz@gmail.com>
Sun, 15 Sep 2019 15:50:32 +0000 (11:50 -0400)
commitdc3626d49df03b1473b2afdd683fcfd2cbe497a9
tree96fb8a3aef0462ee2d1ead18407817430ce3d285
parent92ca66f2cce599b06e5fc24a1a4227f128efd5a7
Fix small sized argument output with tracing enabled (mono/mono#16841)

This is a legacy of before the profiler was used for the trace
output; it would apparently get the raw stack pointer and try to
dereference things by recalculating the offset as needed (no for
little, yes for big). However, because the profiler returns the
actual fixed-up pointer, this recalculation isn't needed on BE,
but instead grabs garbage a bit ahead on the stack.

To fix, use what was the little endian case unconditionally.

Example before:

[1: 20.70598 14] ENTER: System.Globalization.CultureInfo:.ctor (int,bool,bool)(this:700000000408fb0[System.Globalization.CultureInfo platform.exe], 271824864, -32, -32, )

Example after:

[1: 1.93377 14] ENTER: System.Globalization.CultureInfo:.ctor (int,bool,bool)(this:700000000408fb0[System.Globalization.CultureInfo platform.exe], 127, 0, 1)

Commit migrated from https://github.com/mono/mono/commit/babe881bf2753043023ee88b240c85adbcbdd767
src/mono/mono/mini/trace.c