Example Debugging Sessions
9-19
9.5.2 Example 2
This example illustrates the use of hardware-assisted debugging with the
JTAG connection. The example program
hw_dbg.s
is shown in
Appendix A, "Example Programs"
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=i686-pc-cygwin32 --target=sdsp-zsp-elf".
(sdbug)
file a.out
Reading symbols from a.out...done.
(sdbug)
jtag set_clk 2 0 0
(sdbug)
target jtag
Connected to the target JTAG.
(sdbug)
load
.data: 0x 1 .. 0x 1 ... Loading
.text: 0x 0 .. 0x ce ... Loading
(sdbug)
hw enable_ice
(sdbug)
hw insn_addr_brk 0x11
(sdbug)
run
Starting program: hardware_debug.out
Connected to the target JTAG.
.data: 0x 1 .. 0x 1 ... Loading
.text: 0x 0 .. 0x ce ... Loading
Before:
r0:0000 r4:0000 r8:0000 r12:0000
r1:0000 r5:0000 r9:0000 r13:0000
r2:0000 r6:0000 r10:0000 r14:0000
r3:0000 r7:0000 r11:0000 r15:0000
%fmode:0000 %hwflag:0004 %pc:0000 %timer1:0000
%tc:0000 %ireq:0060 %rpc:0000 %loop2:0000
%imask:0000 c10:0000 %tpc:ffff %loop3:0000
%ip0:0000 c11:0000 %cb0_beg:0000 c27:0000
%ip1:0000 %vitr:0000 %cb1_beg:0000 c28:0000
%loop0:0000 c13:0000 %cb0_end:0000 c29:0000
%loop1:0000 amode:0000 %cb1_end:0000 %dei:0000
%guard:0000 %smode:0200 %timer0:0000 %ded:0000
Host: Waiting to scan out of target 6024 bits
Host: Writing scan command
Host: Scanned out of target 6024 bits ffff
Successfully entered HW Debug mode ...
(sdbug)
i r 14
r14
(sdbug)
i r 15
0x00