Go to the first, previous, next, last section, table of contents.

Debugging on Hitachi SH targets

GDB needs to know these things to talk to your Hitachi SH:

  1. that you want to use one of the following:
  2. what serial device connects your host to your Hitachi SH board (the first serial device available on your host is the default).
  3. what speed to use over the serial device.

The last two pieces of information are not needed for `target sim', as the simulator is built in.

Use one of these GDB commands to specify the connection to your target board:

target hms port
To run a program on the board, start up GDB with the name of your program as the argument. To connect to the board, use the command `target hms port', where port is the name of the serial port connected to the board. If the program has not already been downloaded to the board, you may use the load command to download it. You can then use all the usual GDB commands. For example, this sequence connects to the target board through a serial port, and loads and runs a program called prog through the debugger:
host$ h8300-hms-gdb prog
GDB is free software and ...
(gdb) target hms /dev/ttyb
...
(gdb) load
...
(gdb) run
target hms hostname:portnumber
You can specify a TCP/IP connection instead of a serial port, using the syntax hostname:portnumber (assuming your board is connected so that this makes sense; for instance, to a serial line managed by a terminal concentrator).

GDB also supports:

set remotedebug n
You can see some debugging information about communications with the board by setting the remotedebug variable.


Go to the first, previous, next, last section, table of contents.