13.2. Commands for Managing Targets

target type parameters

Connects the debugger host environment to a target machine.

The target command does not repeat if you press Enter again after executing the command.

help target

Displays the names of all targets available. To display targets currently selected, use either info target or info files (see Section 12.1).

help target name

Describe a particular target, including any parameters necessary to select it.

set gnutarget args

The debugger uses its own library BFD to read your files. The debugger knows whether it is reading an executable, a core, or a .o file, however you can specify the file format with the set gnutarget command. Unlike most target commands, with gnutarget the target refers to a program, not a machine.

Note: To specify a file format with set gnutarget, you must know the actual BFD name. See Section 12.1.

show gnutarget

Use the show gnutarget command to display what file format gnutarget is set to read. If you have not set gnutarget, the debugger will determine the file format for each file automatically and show gnutarget displays the following message:


The current BFD target is "auto".

Here are some common targets (available, or not, depending on the debugger configuration):

target remote dev

Remote serial target in the debugger-specific protocol. The argument dev specifies what serial device to use for the connection (e.g. /dev/ttya). See Section 13.3. target remote now supports the load command. This is only useful if you have some other way of getting the debug monitor to the target system, and you can put it somewhere in memory where it won't get clobbered by the download.

target sim

This is the target CPU simulator.

target remote

A target computer connected to the host computer by a serial interface.