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-7
TNS Program Example
For the A command, the length in is 16-bit words. Thus, we divide 48 by 2 to get 2
bytes per 16-bit word. We also use the B display format to group the output into bytes
rather than using the 16-bit words default.
Checking for Open Files
We check for opened files using the find (F) command. We find that there is no
opened file at this point in our example.
We advance to the breakpoint at the end of the EXAMPLE_INIT procedure using the
resume (R) command and verifying our location with the LMAP command. The result:
We can look at the various data locations using the A and D commands, to see the
changes to the variables after we hit the end breakpoint.
We used the value found for HOMETERM_LEN variable, located at L%34, for the
length of the A command. We round up the result to the next even number before
dividing by 2; otherwise, you can lose a byte of information. We also specified the
output to display in byte-form instead of 16-bit word-form by using the B option.
(Options C or B1 could also have been used.)
If we again check for open files by entering the F command, we find that file number 1
is opened. The name of the file matches the file name we saw at the HOMETERM
variable with the A command, above.
Output Display Conversion
Here, we illustrate how to convert from octal to decimal for displaying output data. The
default output for the D command is octal. We can change the output display using the
d-base option. (Use HELP D and HELP d-base for syntax information.) We will look at
the contents of the program’s global PROCESS_HANDLE array in the default form and
in the decimal form. The PROCESS_HANDLE array starts at the program’s global
050,03,00013-F
# -1 ??? # 00000
050,03,00013-R
DEBUG P=%000103, E=%000217, UC.%00-BREAKPOINT-
050,03,00013-LMAP P
EXAMPLE_INIT + %76 (UC.00)
050,03,00013-D UD,%0
%000000: %000001
050,03,00013-D L%34
%000056: %000023
050,03,00013-A L%4, %24/2, B
%000024:\M5.$ZTN00.#PTAZJAC.
050,03,00013-F
# -1 ??? # 00000
#001 \M5.$ZTN00.#PTAZJAC # 00000