Debug Manual
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction
- Execution Modes on TNS/R Systems
- What User Access Is Required for Debugging
- How to Make a Process Enter Debug
- How to Select Debug as the Debugger
- Why a Process Enters Debug
- How to Determine Process State on a Trap or Signal
- Ending a Debug Session
- What Appears in the Debug Header Message
- How to Use Debug
- How Debug Breakpoints Work
- 2 Using Debug on TNS/R Processors
- 3 Debug Command Overview
- 4 Debug Commands
- Command Summary
- A Command
- AMAP Command
- B Command
- BASE Command
- BM Command
- C Command
- CM Command
- D Command
- DJ Command
- DN Command
- EX[IT] Command
- F[ILES] Command
- FC Command
- FN Command
- FNL Command
- FREEZE Command
- HALT Command
- H[ELP] Command
- I Command
- IH Command (TNS/R Native and OSS Processes)
- INSPECT Command
- LMAP Command
- M Command
- MH Command (TNS/R Native and OSS Processes)
- P[AUSE] Command
- PMAP Command (Accelerated Programs)
- PRV Command
- R Command
- S[TOP] Command
- T Command
- V Command
- VQ Command
- VQA Command
- = Command
- ? Command
- A Error Messages
- B ASCII Character Set
- C Command Syntax Summary
- Register Syntax
- Expression Syntax
- Address Syntax
- A Command
- AMAP Command
- B Command
- BASE Command
- BM Command
- C Command
- CM Command
- D Command
- DJ Command
- DN Command
- EX[IT] Command
- F[ILES] Command
- FC Command
- FN Command
- FNL Command
- FREEZE Command
- HALT Command
- H[ELP] Command
- I Command
- IH Command
- INSPECT Command
- LMAP Command
- M Command
- MH Command
- Output-Device Syntax
- P[AUSE] Command
- PMAP Command
- PRV Command
- R Command
- S[TOP] Command
- T Command
- V Command
- VQ Command
- VQA Command
- = Command
- ? Command
- D Session Boundaries
- E Correspondence Between Debug and Inspect Commands
- F Sample Debug Sessions
- Glossary
- Index

Sample Debug Sessions
Debug Manual—421921-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