|The Windowing Interface|
Much of the power of a debugger comes from its enabling you to examine the values assigned to variables, dump the contents of memory, and look at registers. For example, as you step through a program you can examine the contents of an array to see whether it is initialized as you intended.
The SAS/C Debugger includes four windows that are especially useful when you need to take a closer look at your program and the values that it is manipulating. This section explains how to use the Print, Watch, Dump, and Register windows.
|Using the Print Window|
The Print window can be used to
display the value of an expression.
To use the Print window, you direct the output of the
ptr1 was displayed by issuing the
> print ptr1 %s
Use the command prefix
to redirect output from the
>> to redirect
output to an existing Print window.
Also notice that you can specify format when directing
ptr1 should be formatted
as a string. You can use any of the format specifiers that are valid with
sprintf function. See print for more
information about using format specifiers with the
The Print Window
|Using the Watch Window|
The Watch window
is used to track the value of an expression or an area of memory during your
debugging session. It acts like an automatic
dump command, displaying the expression
or area of memory each time control is transferred to the debugger. As shown
in The Watch Window,
you can specify several watches, each of which is displayed in the Watch window.
The Watch Window
be used to specify a watch; however, the easiest way to specify a watch is
to open the Watch window and then set your watches by using the Expr:, N:, and Format: fields. You can use a prefix
field in order to drop watches.
These fields are described in Watch Window.
|Using the Dump Window|
The Dump window is used inorder to display a dump of memory in both character and hexadecimal format. This window is useful when you need to examine a region of memory for possible address space conflicts. For example, it can help you determine why a portion of an array is being overwritten. It can also help isolate the cause of "garbage" information in your data structures.
Output from the
command is directed to the Dump window in much the same way as output from
command prefixes are used with the
to direct the output from a memory dump to either a new or existing Dump window,
as described earlier in Directing Commands to a Window.
For example, the following command dumps 80 bytes of memory that is pointed
to by an expression named
> dump str 80
The output from this
command is directed to a Dump window as illustrated by The Dump Window.
The Dump Window
As shown in The Dump Window, the relative address is displayed on the left side of the Dump window, a hexadecimal representation of the contents of memory is displayed in the middle, and an EBCDIC character representation is displayed on the right side.
|Using the Register Window|
The Register window, shown in The Register Window, enables you to view the contents of the 16 general-purpose registers and the 4 floating-point registers. It also displays the current instruction address and the address mode.
The Register Window
command must be used to open the Register window. Issuing this command when
the Register window is open updates the window. Pressing ENTER when the cursor
is in the Register window also updates it.
Top of Page
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.