[remote] Make registers network byteordered?

Todd Whitesel toddpw@best.com
Wed Mar 21 15:59:00 GMT 2001


Another December twin-dilemma time warp victim...

> Even when you know the target, you may not know its current byte order. 
> I must admit, thought, that it is a very rare situtation to be trying to
> debug a target that switches its byte order.
> 
> Oh, and I've seen people debug targets using the wrong GDB.  Sick yes,
> but it does work.

Commercial debuggers in the USA embedded market generally detect endianness
on startup, or design the issue out of their protocols by using a "network
byte order" concept or endian-neutral formats (like bigendian hex ascii).

Switching endianness after startup is rare, except possibly on bi-endian
targets that set bits at runtime or have memory spaces which can select
the endianness (i960 Cx core series...)  Sounds like a job for JTC's memory
attributes!

In any case, I consider hard-compiled endian assumptions to be disgusting.
It should always be possible to force a specific endianness in the case
where the auto-detect fails for any reason, but it's lame to rely on people
picking the right configure option or typing "set endianness" all the time...

Todd Whitesel
toddpw @ best.com



More information about the Gdb mailing list