[lldb-dev] Registers in expressions on big endian target

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Fri May 4 09:33:42 PDT 2018

> On May 4, 2018, at 12:24 AM, Zdenek Prikryl via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> Hi,
> Is anybody familiar with (De)materializer in the expressions for registers? I'm facing really weird behavior. I have big endian target and if I do register read, I got the correct results (e.g. 0x11223344), but if I do print <reg>, I got 0x44332211. It seems that the EntityRegister swap bytes when Materialize() is handled, but it's not swapped again during Dematerialize(). It's really unfortunate, because I cannot use registers in expressions for breakpoints etc. (the result is always wrong).
> Note that little endian targets are fine.
> Any thoughts how it should be properly fixed?

Fix the Dematerialize() to do the right thing. Shouldn't be hard to see where it isn't flipping the result as it is dematerialized. All debugging is little endian on little endian for most people, so we will need to find these places and fix them.

> --
> Zdenek Prikryl
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

More information about the lldb-dev mailing list