Debugging on Hitachi SH targets
gdb needs to know these things to talk to your Hitachi SH.
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.