Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
Many remote targets require you to download the executable code once you have successfully
established a connection.
load filename Depending on what remote debugging facilities are configured into GDB,
the load command may be available. Where it exists, it is meant to make
filename (an executable) available for debugging on the remote system|by
downloading, or dynamic linking, for example. load also records the
filename symbol table in GDB, like the add-symbol-file command.
If your GDB does not have a load command, attempting to execute it gets
the error message "You can't do that when your target is ...".
The file is loaded at whatever address is specified in the executable. For
some object file formats, you can specify the load address when you link the
program; for other formats, like a.out, the object file format specifies a
fixed address. load does not repeat if you press RET again after using it.
load does not repeat if you press RET again after using it.
Choosing target byte order
Some types of processors, such as the MIPS, PowerPC, and Hitachi 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
can adjust the processor byte order manually using one of the following commands:
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.
Note that these commands merely adjust interpretation of symbolic data on the host, and that they
have absolutely no effect on the target system.
96 Specifying a Debugging Target