Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
with gnutarget the target refers to a program, not a
machine.
Warning: To specify a file format with set gnutarget, you
must know the actual BFD name.
See “Commands to specify files” (page 88).
show gnutarget Use the show gnutarget command to display what file
format gnutarget is set to read. If you have not set
gnutarget, GDB will determine the file format for each
file automatically, and show gnutarget displays `The
current BDF target is "auto"'.
set architecture arch When GDB is built for several different target architectures,
you can choose one of the available architectures with the
set architecture command. This command sets the current
target architecture to arch. The value of arch can be auto,
in addition to one of the supported architectures.
show architecture This command displays the current target architecture.
set download-write-size size Use the set download-write-size size command
to set the write size used when downloading a program.
This command is used when downloading a program onto
a remote target. You can specify zero or a negative value
to disable blocked writes. The actual size of each transfer
is also limited by the size of the target packet and the
memory cache.
show download-write-size Displays the current value of the write size.
Here are some common targets (available, or not, depending on the GDB configuration):
target exec program An executable file. target exec program is the same as
exec-file program.
target core filename A core dump file. target core filename is the same as
core-file filename.
target remote dev Remote serial target in GDB-specific protocol. The argument dev
specifies what serial device to use for the connection (for example,
/dev/ttya). target remote supports the load command. This
is only useful if you have some other way of getting the stub to
the target system, and you can put it somewhere in memory where
it will not get clobbered by the download.
target sim Builtin CPU simulator. GDB includes simulators for most
architectures. In general,the following commands work:
target sim
load
run
However, you cannot assume that a specific memory map, device
drivers, or even basic I/O is available, although some simulators
do provide these.
Some configurations may include these targets as well:
target nrom dev NetROM ROM emulator. This target only
supports downloading.
Different targets are available on different configurations of GDB; your configuration may have
more or fewer targets.
Commands for managing targets 95