xscale endian problems with gdb

I’m using an ixp425 in big endian mode. If gdb is set to big endian, then the info reg command displays the registers backwards but datastructures are shown properly. If set to little endian then registers are shown properly but decode fails elsewhere. Is this a bug or am I missing a command or two?

Looking at the source file src/server/gdb_server.c, I think the problem is that the routines gdb_str_to_target and gdb_target_to_str don’t take into consideration the current processor mode.