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-5
TNS Program Example
12.02 000021 1 1 IF error_main <> 0 THEN
12.021 000024 1 1 DEBUG;
12.022 error_main := SEGMENT_ALLOCATE_ (2, 131064D, !filename;len!,
error_detail);
12.03 000044 1 1 IF error_main <> 0 THEN
12.031 000047 1 1 DEBUG;
12.032 error_main := SEGMENT_ALLOCATE_ (17, 258000D, !filename;len!,
error_detail);
12.04 000070 1 1 IF error_main <> 0 THEN
12.05 000073 1 1 DEBUG;
12.2 000074 1 1 example_fill_array (1);
12.3 000077 1 1 example_fill_array (2);
13. 000102 1 1 example_fill_array (17);
14. 000105 1 1 END; -- example_maim
ERROR_DETAIL Variable INT Direct L+002
ERROR_MAIN Variable INT Direct L+001
GLOBAL MAP
DEBUG Proc External
EXAMPLE_FILL_ARRAY Proc %000000
EXAMPLE_INIT Proc %000000
EXAMPLE_MAIN Proc %000000
FILE_OPEN_ Proc INT External
INITIALIZER Proc INT External
MY_TERMNUM Variable INT Direct
#GLOBAL+000
PROCESSHANDLE_NULLIT_ Proc INT External
PROCESS_GETINFO_ Proc INT External
PROCESS_HANDLE Variable INT Direct
#GLOBAL+001
SEGMENT_ALLOCATE_ Proc INT External
SEGMENT_USE_ Proc INT External
SP Variable STRING EXT Pointer
#GLOBAL+013
WRITEREADX Proc External
LOAD MAPS
ENTRY POINT MAP BY NAME FOR FILE: \NODE.demo1
SP PEP BASE LIMIT ENTRY ATTRS NAME DATE TIME
00 003 000104 000210 000104 EXAMPLE_FILL_ARRAY 1998-07-08 14:53
00 002 000005 000103 000005 EXAMPLE_INIT 1998-07-08 14:53
00 004 000211 000320 000211 M EXAMPLE_MAIN 1998-07-08 14:53
LOAD MAPS
DATA BLOCK MAP BY NAME FOR FILE: \NODE.demo1
BASE LIMIT TYPE MODE NAME DATE TIME
000000 000014 COMMON WORD #GLOBAL 1998-07-08 14:53
To start debugging the program in Example F-2 on page F-4, enter RUND demo1. If
the program starts in Inspect, then it was not compiled with the compiler directives
shown. To switch to Debug, enter the Inspect command SELECT DEBUGGER
DEBUG. This output is displayed:
DEBUG P=%000211, E=%000207, UC.%00
Break command
The first Debug command that we are going to demonstrate is the break (B) command.
To look at the before and after result that occurs when running the EXAMPLE_INIT
procedure of our sample program, we put a breakpoint at the beginning and at the end
of the procedure. From the ENTRY POINT MAP (Example F-2 on page F-4), we find
that the EXAMPLE_INIT procedure starts at SP 0 and ENTRY 5 (octal).