Debug Manual

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