# The Target Selection Dialog

### Overview

The Target Selection Dialog allows users to specify the debug target, the interface used to connect to the target, and some useful run options.

Target Selection topics:

- Selecting a Target
  - Specifying a Target
  - Choosing a Connection Interface
- Options
  - Run until 'main'
  - Set breakpoint at 'exit'
  - Display Download Dialog
- More Options
  - Attach to Target
  - Download Program
  - Run Program
  - Continue from Last Stop

### Selecting a Target

Selecting a target involves choosing a target for debugging and setting connection interface options for the target.

Common targets include: "Exec" for native debuggers, "Remote/Serial" for establishing a connection to a target board via a serial line, "Remote/TCP" for TCP connections, and "Simulator" for connections to the simulator. There may be more depending on the configuration of the debugger being used.

In general, "remote" targets are always serial connections which require the user to specify the serial port and baud rate to be used for the connection and "remote/tcp" targets are always TCP connections which require specifying the hostname and port number of the machine to which to connect. Depending upon configuration, there may be numerous serial- and TCP-based connections. These always follow the naming convention target/Serial and target/TCP.

To select a target, choose one of the available targets from the dropdown menu in the Connection Frame. Then specify the interface options for this target: selecting the baudrate and serial port from the dropdown menus (serial targets only) or entering the hostname and port number (TCP targets only).

### Options

Three run options which may be selected include:

Run until 'main'
  Sets a breakpoint at main()
Set breakpoint at 'exit'
  Sets a breakpoint at exit()
Display Download Dialog
  Displays a dialog showing the progress of the download to the target section by section

### More Options

Several additional run options may be set for each target from the Target Selection Dialog. These options govern the behavior of the debugger's Run Button. The debugger automatically selects default values for these options whenever a target is selected with the dropdown menu in the Connection Frame. To modify this default bahavior, click the small triangle next to "More Options" at the bottom of the dialog. The Run Options for the current target are displayed, allowing modification of the actions for the target. When the "OK" button is selected, these settings are saved and will be used as the default for the target in future sessions.

Attach to Target
  Establish a connection to the target board.
Download Program
  Download the program to the target board.
Run Program
  Run the program on the target board, creating a new "process". This option may not be specified along with the continue option. See note below.
Continue from Last Stop
  Continue the program on the target board from where it last stopped. This option may not be specified along with the "run" option. See note below.

Note that all remote targets typically do not "run" programs. Since target boards are usually incapable of creating a new "process", these targets seldom "Run". The defaults for all remote targets reflect this distinction: they are all set to "Continue".

Only one of the options "Run Program" and "Continue from Last Stop" may be used. Typically, the default behavior of this setting should not be altered.