Debug Manual

Table Of Contents
Sample Debug Sessions
Debug Manual421921-003
F-3
TNS Program Example
14 END; -- example_maim
TNS Program Example
Example F-2 on page F-4 is a TNS program, obtained by compiling the source code
(Example F-1 on page F-2) with TAL. Before we demonstrate the use of the Debug
commands, we first need to compile this program to obtain an object file. The TAL
compiler command entered is as follows:
TAL /IN sdemo1, OUT $S.#ldemo1/ demo1; OPTIMIZE 0, LIST, NOINSPECT
OPTIMIZE 0 is used to make debugging easier. It forces intermediate results into
memory instead of being held in the registers. While this makes debugging easier, it
also results in slower code execution. For more information about using other
OPTIMIZE values, refer to the TAL Reference Manual.
The following is the TNS example program that we will use to demonstrate the use of
various Debug commands.
The TNS example program does not do much, but it has enough function to illustrate
the use of most of the Debug commands.
The listing below shows the output of the TAL compiler and BINSERV, the binder.
Observe these three parts of the listing:
The 6-digit column shown on the left side of each procedure gives the relative
offset, in octal, for the first instruction of the line.
The register addresses of variables declared in the procedure are shown at the
end of the procedure.
The ENTRY POINT MAP shown at the end of the listing gives the base address for
each procedure. If you don't have the program listing you can use the binder LMAP
command to show information (for example, BIND LMAP FROM demo1).
Note. If you try these examples, there might be some differences between your output
information and ours. These differences might be caused by changes to the program,
changes to the compiler, the program running on a different system and processor,
process number, and having a different terminal name. The following is the object file
listing of the source program in Example F-1
on page F-2, minus some of the output
information that is not relevant to our discussion.