Previous: Target Commands, Up: Targets


19.3 Choosing Target Byte Order

Some types of processors, such as the MIPS, PowerPC, and Renesas SH, offer the ability to run either big-endian or little-endian byte orders. Usually the executable or symbol will include a bit to designate the endian-ness, and you will not need to worry about which to use. However, you may still find it useful to adjust gdb's idea of processor endian-ness manually.

set endian big
Instruct gdb to assume the target is big-endian.
set endian little
Instruct gdb to assume the target is little-endian.
set endian auto
Instruct gdb to use the byte order associated with the executable.
show endian
Display gdb's current idea of the target byte order.

If the set endian auto mode is in effect and no executable has been selected, then the endianness used is the last one chosen either by one of the set endian big and set endian little commands or by inferring from the last executable used. If no endianness has been previously chosen, then the default for this mode is inferred from the target gdb has been built for, and is little if the name of the target CPU has an el suffix and big otherwise.

Note that these commands merely adjust interpretation of symbolic data on the host, and that they have absolutely no effect on the target system.