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-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