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-21
TNS Program Example
Execute Breakpoint
The next example shows the execute breakpoint using the BM command. We first run
the object code: RUND demo1.
We put a memory-access breakpoint on the first word of data pointed to by the
IN_OUT_MESSAGE pointer in the EXAMPLE_FILL_ARRAY procedure. We stop at
the beginning of the procedure and look at the value of the IN_OUT_MESSAGE
pointer.
The pointer has not been set at this point in the program. We put a breakpoint a few
instructions ahead and look at the pointer again.
Now the stack has been set up, so there is a value in the pointer. Remember that this
is a string pointer, so the value is a byte offset into the UD area. Because we no longer
need the code breakpoints, we clear them. We use the BM command to set a memory-
access breakpoint. We also use the command-string option to make an execute
breakpoint.
Because we are using an indirect variable, we need to be at a location where the
pointer has been established. For information about indirect addressing, see Section 3,
Debug Command Overview. Thus the address of 0x00000032 shown in the output for
the BM command is in the user data segment (UD). Whenever the location is written,
we execute the LMAP command, the A command, and resume.
050,03,00027-b %104
ADDR: UC.%00,%000104 INS: %002002 SEG: %020737
INS: ADDS +002
050,03,00027-r
DEBUG P=%000104, E=%000207, UC.%00-BREAKPOINT-
050,03,00027-d l3
%000026: %000000
050,03,00027-b %104+%15
ADDR: UC.%00,%000121 INS: %040402 SEG: %020737
INS: LOAD L+002
050,03,00027-r
DEBUG P=%000121, E=%000217, UC.%00-BREAKPOINT-
050,03,00027-d L3
%000026: %000062
050,03,00027-c *
050,03,00027-bm L3s, w, (lmap p;a L3s, #40/2, c;r)
XA: 0x00000032 MAB: W (DATA SEG)
(LMAP P;A L3S, #40/2, C;R)