Fix debugger memory display of little-endian memory regions [Alex Jackson]

This commit is contained in:
Alex W. Jackson 2014-12-09 21:18:05 -05:00
parent b5f303f809
commit adfefa9f34
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ debug_view_memory_source::debug_view_memory_source(const char *name, memory_regi
m_memintf(NULL),
m_base(region.base()),
m_length(region.bytes()),
m_offsetxor(NATIVE_ENDIAN_VALUE_LE_BE(region.bytewidth() - 1, 0)),
m_offsetxor(ENDIAN_VALUE_NE_NNE(region.endianness(), 0, region.bytewidth() - 1)),
m_endianness(region.endianness()),
m_prefsize(MIN(region.bytewidth(), 8))
{

View File

@ -239,7 +239,7 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); }
#define NATIVE_ENDIAN_VALUE_LE_BE(leval,beval) ENDIAN_VALUE_LE_BE(ENDIANNESS_NATIVE, leval, beval)
// endian-based value: first value is if 'endian' matches native, second is if 'endian' doesn't match native
#define ENDIAN_VALUE_NE_NNE(endian,leval,beval) (((endian) == ENDIANNESS_NATIVE) ? (neval) : (nneval))
#define ENDIAN_VALUE_NE_NNE(endian,neval,nneval) (((endian) == ENDIANNESS_NATIVE) ? (neval) : (nneval))
// useful macros to deal with bit shuffling encryptions