Debug Manual

Table Of Contents
Sample Debug Sessions
Debug Manual421921-003
F-38
Native Program Example
Clearing Breakpoints
We view all the remaining breakpoints we have set, clear them, then show that they
are gone:
Setting Breakpoints Within a Procedure
In our first native code breakpoint example, we use the EXAMPLE_INIT procedure to
emphasize debugging more on a global scope. The following example uses, the
EXAMPLE_FILL_ARRAY procedure to emphasize debugging on a narrower (local)
scope. In this example we demonstrate the B command as well as other Debug
commands that we did not use with the EXAMPLE_INIT procedure.
I Command
We set breakpoints near the beginning and near the end of EXAMPLE_FILL_ARRAY
procedure and resume to the first breakpoint. From our noft listing, we find that the
procedure starts at 0x70000464 and is 268 bytes long. If we look at the first few
instructions of the procedure, we observe:
The first five instructions set up the stack for the EXAMPLE_FILL_ARRAY procedure.
The instruction at 0x70000478 sets up the parameters for JAL at 0x70000484. This
JAL is the call to the SEGMENT_USE_ procedure.
B Command
We put the beginning breakpoint at 0x70000478 and the end breakpoint at the second
instruction from the end of the procedure.
050,03,00266-B
N: 0x7000039C INS: 0x00002025
INS: OR a0,$0,$0
N: 0x7000045C INS: 0x03E00008
INS: JR ra
N: 0x700005B0 INS: 0x87AF0046
INS: LH t7,70(sp)
050,03,00266-C *
050,03,00266-B
050,03,00266-I 0x70000464, #10
70000464: ADDIU sp,sp,-128 SW ra,60(sp) SW a0,128(sp)
70000470: SW s1,56(sp) SW s0,52(sp) LUI a0,0x8000
7000047C: LH a1,130(sp) SW $0,44(sp)
70000484: JAL 0x7F805228 NOP
050,03,00266-B 0x70000478
N: 0x70000478 INS: 0x3C048000
INS: LUI a0,0x8000
050,03,00266-B 0x70000464 + #268 - (4 * 2)
N: 0x70000568 INS: 0x03E00008
INS: JR ra