Contents|Index|Previous|Next
Debugging
on Hitachi SH targets
GDB
needs to know the following things to talk to your Hitachi SH.
-
Specifications for one of the
following interfaces:
-
target remote,
GDB’s generic debugging protocol. Use src/gdb/config/sh/stub.c
to connect to the SH chip. See Options
for debugging your program or GNU CC in Using
GNU CC in GNUPro Compiler Tools.
-
target e7000,
the E7000 in-circuit emulator for the Hitachi SH.
-
target hms,
the HMS monitor on SH and H8/300 boards.
-
target sim,
the simulator, which allows you to run GDB remotely without an external
device.
-
Specifications for what serial
device connects your host to your Hitachi SH board (the first serial device
available on your host is the default).
-
Specifications for what speed
to use over the serial device.
The previous two specifications
aren’t necessary for target
sim, as the simulator
is built in. Use one of the following 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, the following sequence connects to the target board through a
serial port, then loads and runs a program, prog,
through the debugger.
host$ h8300-hms-gdb prog
GDB is free software and...
(gdb) target remote /dev/ttyb
...
(gdb) load
...
(gdb) run
target interface 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 remotedebug.
Top|Contents|Index|Previous|Next