f78
Note:
The Hitachi LCEVB running
CMON has the stub already built-in.
Use the following gdb command if you need to explicitly set the serial device.
device portThe default, port, is the first available port on your host. This is only necessary on Unix hosts, where it is typically something like /dev/ttya.
The following sample session illustrates the steps needed to start a program under gdb control on an H8/300, using a DOS host. The example uses a sample H8 program called ‘t.x’. The procedure is the same for other Hitachi chips in the series. First, hook up your development board. In the example that follows, we use a board attached to serial port COM1.
1.
Call gdb
with the name of your program as the argument.
gdb filename2.
(gdb) ffb
3.
Use the following two special
commands to begin your debugging session.
load filename
load
displays the names of the program’s sections. (If you want to refresh gdb
data on symbols or on the executable file without downloading, use the
gdb
commands, file,
or symbol-file).
These commands, and load itself, are described in Commands to specify files in Debugging with GDB in GNUPro Debugging Tools. The following message then appears.
C:\H8\TEST> gdb t.x
GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.15-96q1, Copyright 1994 Free Software Foundation, Inc...
(gdb) target hms com1 Connected to remote H8/300 HMS system. (gdb) load t.x .text: 0x8000 .. 0xabde *********** .data: 0xabde .. 0xad30 * .stack: 0xf000 .. 0xf014 *At this point, you’re ready to run or debug your program. Now you can use all of the following gdb commands.
run
Start your program.
print
Display data.
continue
Resume execution after stopping
at a breakpoint.
help
Display full information
about gdb
commands.
Note:
Remember that operating
system facilities aren’t available on your development board. For example,
if your program hangs, you can’t send an in
3ef
terrupt—but you can press the
RESET
switch to interrupt your program (don’t use Ctrl-C
on the DOS host—it has no way to pass an interrupt signal to the development
board). Return to your program’s process with the(gdb)
command prompt after your program finishes its hanging normally. The communications
protocol provides no other way for gdb
to detect program completion. In either case, gdb
sees the effect of a reset on the development board as a “normal exit”
of your program.