Debug Manual

Table Of Contents
Sample Debug Sessions
Debug Manual421921-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).