Debug Manual

Table Of Contents
Sample Debug Sessions
Debug Manual421921-003
F-45
Native Program Example
Tracing Breakpoint
Here, we demonstrate the breakpoint tracing capability. First, we run the program as
follows: RUND ndemo1. We then set the base output to hexadecimal to make the
outputs more familiar for native code programmers.
Conditional Breakpoint
The next example shows the conditional breakpoint. We stop a code breakpoint in the
EXAMPLE_FILL_ARRAY procedure when the ARRAY_NUM parameter is greater than
16. (Note that the third call to the EXAMPLE_FILL_ARRAY procedure is 17 in the
native object code listing above.) We put a breakpoint in the EXAMPLE_FILL_ARRAY
DEBUG $PC=0x70000570
050,03,00265-base hex out
050,03,00265-b 0x70000478
N: 0x70000478 INS: 0x3C048000
INS: LUI a0,0x8000
050,03,00265-r
DEBUG $PC=0x70000478 -RISC BREAKPOINT ($PC: 0x70000478)-
050,03,00265-c
050,03,00265-= $SP + %h82
= %11777777352 #1342177002 0x4FFFFEEA 'O...'
050,03,00265-b 0x70000478, N 0x4FFFFEEA ? 1
N: 0x70000478 INS: 0x3C048000
INS: LUI a0,0x8000
N 0x4FFFFEEA ? 0x00000001
050,03,00265-b 0x70000464 + #268 - (4 * 2), N 0x00080028 ? #16/2
N: 0x70000568 INS: 0x03E00008
INS: JR ra
N 0x00080028 ? 0x00000008
050,03,00265-r
TRACE $PC=0x70000478
4FFFFEEA: 0x0001
enter some data
abcdefg
TRACE $PC=0x70000568
00080028: 0x0061 0x6263 0x6465 0x6667 0x0000 0x0000 0x0000 0x0000
TRACE $PC=0x70000478
4FFFFEEA: 0x0002
enter some data
hijklmnop
TRACE $PC=0x70000568
00080028: 0x0068 0x696A 0x6B6C 0x6D6E 0x6F70 0x0000 0x0000 0x0000
TRACE $PC=0x70000478
4FFFFEEA: 0x0011
enter some data
uvwxyz0123
TRACE $PC=0x70000568
00080028: 0x0075 0x7677 0x7879 0x7A30 0x3132 0x3300 0x0000 0x0000