
9-16
Debugger
9.5.1 Example 1
In this sample debugging session, the executable is built from the C and
assembly programs shown in
Appendix A, "Example Programs"
The
name of the executable is
demo.exe
, and the start address is 0x1000.
The target is set to the functional-accurate simulator (ZISIM) for the
LSI402Z. The complete command name is used the first time the
command is invoked (for example,
backtrace
); subsequent invocations
use the abbreviated command name (
bt
).
(shell)
sdbug400
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "--host=sparc-sun-solaris2.6 --target=sdsp-zsp-elf"...
(sdbug)
file demo.exe
Reading symbols from demo.exe...done.
(sdbug)
target sim
Connected to the simulator.
(sdbug)
load demo.exe
.text : 0x 0 .. 0x cd ... Loading
.data : 0x cd .. 0x cf ... Loading
Transfer rate: 3312 bits in <1 sec.
(sdbug)
breakpoint main
Breakpoint 1 at 0x13: file demo.c, line 9.
(sdbug)
b func_1
Breakpoint 2 at 0x56: file func1.s, line 9.
(sdbug)
b func_2
Breakpoint 3 at 0x89: file func2.c, line 4.
(sdbug)
b func_3
Breakpoint 4 at 0x70: file func1.s, line 50.
(sdbug)
run
Starting program: /user/Tools/MyProject02/demo.exe
Breakpoint 1, main () at demo.c:9
9 char ch = ’A’;
(sdbug)
list
4
5 int t=500;
6
7 main()
8 {
9 char ch = ’A’;
10 int i,j = 100,k;
11
12 for (i=0; i< 2; i++) {
13 func_2();