Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

XENIX Programming adb: Program Debugger Since execution to this point caused no errors, you can remove the first breakpoint by typing f:dl and continue the program by typing :co adb displays the message sample: running and starts the program at the next instruction. Execution continues until the next breakpoint where adb displays the message breakpoint _ g: push bp You can now trace the path of execution by typing $c The command shows that only two functions are active: main and f. f(1.,1.) - main (1.,470.) from main + 6. from -start + 114. Although the breakpoint has been set at the start of function g, it will not be listed in the backtrace until its first few instructions have been executed. To execute these instructions, type ,S:s adb single-steps the first five instructions. Now you can list the backtrace again. Type $c This time the list shows three active functions: g (2.,3.) - f(1.,1.) - main (1.,470.) from f + 48. from - main + 6. from - start + 114. 6-2 1

adb: Program Debugger XENIX Programming You can display the contents of the integer variable fcnt by typing fcnt/d This command displays the value of fcnt found in memory. The number should be 1. You can continue execution of the program and skip the first ten breakpoints by typing ,10:co adb starts the program and displays the running message again. program until exactly ten breakpoints have been encountered. message breakpoint _g : push bp It does not stop the It then displays the To show that these breakpoints have been skipped, you can display the backtrace again using $c. f (2., 11.) from h + 46: - h (1 0., 9.) from - g +48: g ( 11., 20.) from - f + 48: - f (2., 9.) - from h + 46: - h (8., 7.) from - g +48: g (9., 16.) - from f+48: - f (2., 7.) - from h + 46: - h (6., 5.) from - g +48: g (7., 12.) - from f+ 48: - f (2., 5.) from h +46: - h (4., 3.) from - g + 48: g (5., 8.) from - f + 48: - f (2., 3.) - from h + 46: - h (2., 1.) from - g +48: - Using the adb Memory Maps adb prepares a set of maps for the text and data segments in your program and uses these maps to access items that you request for display. The following sections describe how to view these maps and how they are used to access the text and data segments. Displaying the Memory Maps You can display the contents of the memory maps by using the $m command. The command has the form $m [ segment ] where segment is the number of a segment used in the program. 6-22

adb: Program Debugger <strong>XENIX</strong> Programming<br />

You can display the contents of the integer variable fcnt by typing<br />

fcnt/d<br />

This command displays the value of fcnt found in memory. The number should be 1.<br />

You can continue execution of the program and skip the first ten breakpoints by typing<br />

,10:co<br />

adb starts the program and displays the running message again.<br />

program until exactly ten breakpoints have been encountered.<br />

message<br />

breakpoint _g : push bp<br />

It does not stop the<br />

It then displays the<br />

To show that these breakpoints have been skipped, you can display the backtrace again<br />

using $c.<br />

f (2., 11.) from h + 46:<br />

-<br />

h (1 0., 9.) from -<br />

g +48:<br />

g ( 11., 20.) from -<br />

f + 48:<br />

-<br />

f (2., 9.)<br />

-<br />

from h + 46:<br />

-<br />

h (8., 7.) from -<br />

g +48:<br />

g (9., 16.)<br />

-<br />

from f+48:<br />

-<br />

f (2., 7.)<br />

-<br />

from h + 46:<br />

-<br />

h (6., 5.) from -<br />

g +48:<br />

g (7., 12.)<br />

-<br />

from f+ 48:<br />

-<br />

f (2., 5.) from h +46:<br />

-<br />

h (4., 3.) from -<br />

g + 48:<br />

g (5., 8.) from -<br />

f + 48:<br />

-<br />

f (2., 3.)<br />

-<br />

from h + 46:<br />

-<br />

h (2., 1.) from -<br />

g +48:<br />

-<br />

Using the adb Memory Maps<br />

adb prepares a set of maps for the text and data segments in your program and uses<br />

these maps to access items that you request for display. The following sections describe<br />

how to view these maps and how they are used to access the text and data segments.<br />

Displaying the Memory Maps<br />

You can display the contents of the memory maps by using the $m command. The<br />

command has the form<br />

$m [ segment ]<br />

where segment is the number of a segment used in the program.<br />

6-22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!