ARM BE8 support is broken

toemoss garcia
Thu Nov 19 18:12:00 GMT 2015

Hi gdb-experts,

I've been having quite a headache working with GDB on
a (proprietary) mixed-endian processor that is built around a ARM
cortexm3 using arm's BE8 big endian variant. If you don't know,
BE8 architecture treats instructions as little endian and data as
big endian. The additional wrinkle is that anything in the system
control memory space (0xE000E000-0xE000F000) and the external
private peripheral bus (0xE0000000-0xE00FFFFF) is *also* treated
as little endian [1]. At least for the cortex-m.

There has been *some* support added for BE8 in GDB, but as far as
I can tell, all the patches do is treat everything as BE and
manually swap instructions to LE (see [2] for the patch
submission). This only seems to effect doing a ``load`` or when
reading a memory address as an instruction. There doesn't seem to
be any actual support for correctly reading/writing memory based
on the region of memory space. IOW, the only thing you can do
reliably for BE8 is load a program to the core (this seems to
always work correctly for BE8 images).

Is there anything in the works/any interest in getting this kind
of support added?

Does anybody have experience using BE8 with GDB? How did
you "solve" this?

[1] The definitive guide to the ARM Cortex-M3
    Page 97 (section 5.8) on this version:

[2] Subject: [RFA] ARM BE8 support

More information about the Gdb mailing list