Chapter Contents

Previous

Next
Using Debugger Commands

Windowing Interface and Command Execution

This section describes window subcommands, how to issue commands, and how placeholders are used in debugger commands.


Window Operations and Window Subcommands

This section explains window commands that are issued outside the PROFILE and configuration files. See Debugger PROFILEs, Configuration Files, and EXECs for information about the window command in a PROFILE or configuration file.

The window command is used to perform a variety of window functions: clearing windows, closing windows, moving windows, opening windows, resizing windows, scrolling windows, and so on. Each of these functions is performed by a subcommand of the window command. For example, to use the scroll source up subcommand, you type window scroll source up; scroll is a subcommand of the window command.

On completing its execution of most window-oriented commands, the debugger does not move the cursor out of the window. Therefore, the following commands, which are issued when the debugger is running, are useful when they are assigned to PF keys:

Useful Commands to Assign to PF Keys
Command Description
autopop
automatically pops (unobscures) the window when updated.
border
specifies the characters used to form window borders.
clear* clears the named window.
close* closes the named window.
color* changes the color, attributes, and intensity of various areas in a window.
context* controls the amount of context information around the highlighted line in the Source window.
move* moves the named window.
next
positions the top window at the bottom of the stack. The window below the window just moved becomes the top window.
off
switches the debugger to line mode.
on
switches the debugger to full-screen mode.
open* opens the named window.
previous
positions the bottom window at the top of the stack and makes it the top window.
resize* resizes (grows or shrinks) the window.
scroll* scrolls windows (up and down, and left and right), as well as changes the scroll amount.
top* positions the named window at the top of the stack. The physical cursor appears in this window at the place of the logical cursor. The window becomes the top window.
trace}*
controls the production of trace lines in the Log window.
zoom* zooms the named window. If already zoomed, the window is unzoomed.
* These subcommands take a window name as a parameter.

The usual abbreviation conventions, which apply to all debugger commands, also apply to these subcommands. A complete description of each subcommand is provided in Command Directory.


Methods of Issuing Commands

Commands can be issued by typing them in the Command window and pressing the ENTER key. However, this can be quite cumbersome for frequently used commands, for example, scroll up, scroll down, and close.

Window commands, like most other commands, can be assigned to PF keys. See Using PF Keys for details about default PF key assignments and how they may be modified.


Placeholders in Commands

Many commands, including window subcommands and commands that take expressions as arguments, can be assigned to PF keys using a placeholder to indicate the position at which an argument is to be inserted. If a command contains a placeholder, then the position of the cursor is used to determine the value of the argument that is inserted in place of the placeholder.

Using Placeholders in Window Subcommands

Several of the window subcommands take WINDOW-NAME as a command argument. If you want to use the cursor to point to the window, a placeholder (syntax < >) is used in these subcommands instead of the window name.

The following example illustrates the use of placeholders with window subcommands. Most windows can be scrolled back using the following command:

window scroll WINDOW-NAME up

You could assign this command to a PF key as a text string, substituting the name of a window for WINDOW-NAME. Whenever you press the assigned PF key, the window would be scrolled up. However, you can also assign the following command to a PF key:

window scroll < > up

Pressing the PF key that is assigned to this command causes the window that the cursor is in to scroll up.

Placeholders in Commands That Take Expressions

You can also use placeholders with commands that take expressions, thus simplifying the execution of frequently used expression-handling commands. One or more placeholders, < >, can be specified in a command that is assigned to a PF key. When you issue this command by pressing the PF key, you can use the cursor to point to the expression that replaces all occurrences of the placeholder in the command.

For example, the print command can be submitted, like any other command, in the Command window. However, as print is one of the most commonly used commands to display expressions, you can assign print < > to a PF key. Moving the cursor to an expression and pressing that PF key would cause the debugger to replace the placeholder with the expression, and issue the print command.

Similarly, in an application that performs much text-string manipulation, you may frequently issue a dump expression str command. You can assign dump < > str to a PF key. Moving the cursor to an expression and pressing that PF key would cause the debugger to replace the placeholder with the expression, and dump the string.

Expression extraction Expressions occupying contiguous characters on one line in a window can be substituted for a placeholder in a command that is assigned to a PF key. The process of extracting an expression for substitution in a command is referred to as expression extraction. If the area of the window that contains the expression is unprotected, you can modify the expression before extraction.

The debugger uses an algorithm to identify the portion of the expression that replaces the placeholder. The rules for determining the extracted expression are described in the following section.


Extracting Expressions

The debugger uses an algorithm to extract expressions from the surrounding text. The debugger first does a preliminary backward scan until it encounters one of the following characters: a left parenthesis, a right parenthesis, a left bracket, or a character that is valid in an identifier. For debugger purposes, $ is also considered to be a character that is valid in an identifier. (If the debugger is already on such a character, this preliminary scan is not needed.) If the backward scan cannot find one of these characters, there is no expression to be extracted. Processing then depends on the character that is encountered:

Placeholder Expression Extraction illustrates how the expression to be extracted depends on cursor position. When you read the table, assume the cursor is at the position shown in the expression in the first column. The third column shows the extracted text. The examples illustrate what would happen if the cursor were in one of several positions. In those cases, the cursor appears somewhere within the range indicated by the text shown in the second column of Placeholder Expression Extraction.

Placeholder Expression Extraction
Window Text Cursor Position (table note 1) Extracted Text
pntr[str.ind][5]->mem1.mem2
pntr[str.ind][5]-> mem1.mem2
pntr[str.ind][ 5]->mem1.mem2
pntr[str.ind] [5]->mem1.mem2
pntr[str. ind][5]->mem1.mem2
pntr[ str.ind][5]->mem1.mem2
pntr [str.ind][5]->mem1.mem2
pntr[str.ind][5]->mem1.mem2
(a+b-c )
(a+b-c)
(p=5)-> aa.bb
(*p). aa.bb
mem2
 mem1
 5]->
 [
 ind]
 str.
 [
pntr
 )
 (
 aa.
 aa.
pntr[str.ind] [5]->mem1.mem2
pntr[str.ind] [5]->mem1.
5
pntr[str.ind][5]
str.ind
str
pntr[str.ind]
pntr
(a+b-c)
(a+b-c)
(p+5)->aa
(*p).aa

TABLE NOTE 1:   All of the ranges listed in the Cursor Position column include a leading blank space except for mem2 and pntr. Placing your cursor in the leading blank returns the extracted text the same as placing your cursor within the rest of the range. [arrow]

As shown by Placeholder Expression Extraction, arbitrary expressions may be extracted by surrounding them with parentheses.

When the cursor is moved under the expression that is to replace the placeholder, and one of the methods described in Methods of Issuing Commands is used to execute the command, the debugger extracts the expression and substitutes it for the placeholder in the command being issued.

The algorithm used by the debugger to extract expressions does not handle numeric constants; positioning the cursor on numeric constants may lead to unpredictable results. However, numeric constants can be specified as part of an expression enclosed in parentheses.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.