Debugging on targets for Hitachi H8/300
gdb needs to know the following specifications to talk to your Hitachi H8/300.
target remote
gdb’s generic
debugging protocol, for using with the Hitachi low-cost evaluation board
(LCEVB) running CMON.
target hms
Interface to H8/300
eval
boards running the HMS monitor.
target e7000
E7000 in-circuit
emulator for the Hitachi H8/300.
target sim
Simulator, which
allows you to run gdb
remotely without an external device.
Use one of the following gdb commands to specify the connection to your target board.
target interface 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
interface port,
where interface
is an interface from the previous list and 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 example’s 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 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 the variable, remotedebug.