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

Debug Commands
Debug Manual—421921-003
4-10
Set Unconditional Code Breakpoint
101 int getloc(void)
102 {
103 int loc_num, i_val, tm, *row;
.
.
115 if (i_val == loc_num)
116 return nextloc (row, loc_num);
In a native program, the address of the base of a function or procedure can be
determined using the noft utility. After noft has been started and the name of the
object file has been provided, the function getloc is specified with the listproc
command:
noft> listproc getloc
This command causes noft to display the base address of the function getloc.
Procedure : # Address
getloc : 2 0x70000448
The address displayed is then supplied as input to the dumpaddress command. This
command causes noft to display disassembled native code starting at the beginning of
getloc for forty 32-bit words:
noft> dumpaddress 0x70000448 for 40 words
The resulting display includes the RISC code associated with source line 115. (The
source line number is multiplied by 1000 in the display.)
Procedure Src Line Address Long Word Instructions
----------------------------------------------------------------
--
.
[getloc 115000] 0x700004a4 0x8fae008c lw t6,0x8c(sp)
[getloc 115000] 0x700004a8 0x8faf0088 lw t7,0x88(sp)
[getloc 115000] 0x700004ac 0x0000000000 nop
[getloc 115000] 0x700004b0 0x15cf0009 bne t6,t7,0x700004d8
[getloc 115000] 0x700004b4 0x0000000000 nop
.
The display shows the first instruction associated with line 115 to be at 0x700004A4. A
breakpoint is placed at that location:
106,06,00125-B 0x700004A4 ! (set breakpoint)
N: 0x700004A4 INS: LW t6,140(sp)
106,06,00125-R ! (resume)
The process enters the debug state each time the instruction at RISC address
0x700004A4 is executed.
DEBUG PC=0x700004A4 -RISC BREAKPOINT ($PC:0x700004A4)-
Note. In optimized code, instructions might be rearranged in the object file. Where possible,
noft indicates this by a “+” or “-” in the dumpaddress display. In highly optimized code, you
might have to rely on your own judgment to decide where a breakpoint is appropriate.