TOC PREV NEXT INDEX DOC LIST MASTER INDEX



 

Using the Apex Debugger

The Apex debugger offers a powerful set of features to help you find bugs and analyze your program's behavior. It supports source level debugging for Ada, C, and C++, including programs comprising mixtures of these languages.

Note: Support for these languages is dependent on the variant of Apex (Apex Ada, Apex C/C++, or Apex Duo) you have. Apex Duo supports all Ada and C/C++ debugging capabilities described in this manual.

This chapter provides an overview of debugger capabilities and interfaces. The following sections are included in this chapter:


Overview

The debugger operates either at the source level or at the machine level. In source level debugging, you deal with your program's source as it was compiled. You can set breakpoints at source line numbers, statements, or declarations. When you print out variables, the values are displayed in a format appropriate to their declared type. You can also define your own custom display methods that the debugger will use for objects of the specified types.

In machine mode, the debugger displays the source disassembled into the machine instructions generated by the compiler. You can dump or modify memory in a variety of formats —— decimal, hexadecimal, octal, and binary. The debugger lets you display and modify machine registers. You can set breakpoints on or single step through individual instructions. Machine level debugging is discussed in detail in Machine Level Debugging

You can control the execution of your program through commands that place breakpoints and continue execution. The breakpoints can have conditions and actions associated with them. You can step through your program at both the source and machine level, stepping either into or over Ada subprograms or C/C++ functions at either level. You can also invoke Ada subprograms or C/C++ functions in your program directly from the debugger. Debugger execution is described in Controlling Execution.

The debugger lets you control the language exceptions and UNIX signals while your program is executing. You can stop execution at specified signals or exceptions or let them be automatically propagated to your program. Exceptions are described in Handling Exceptions

The debugger has several interfaces. There is an easy-to-use Graphical User Interface that provides menu-driven access to the debugger's facilities. The debugger GUI is described in The Debugger's GUI. The GUI debugger also contains a powerful command language that provides short-cuts to commands. This command language is also accessible through a non-GUI, text-based interface. An overview of this interface is provided in The Debugger's Command-Line Interface.

The debugger has many other features. An easy way to become familiar with the Apex debugger is to work through the Using the Debugger"exercise in the Online Tutorial. The exercise can provide you with some valuable hands-on experience in using the debugger. If you are not familiar with the Apex debugger, it is recommended that you work through this exercise before you read this chapter. For a less complex exercise in using the debugger, a quick tutorial is provided in Getting Started with the Debugger.


The Debugger's GUI

A special graphical user interface is provided with the Apex debugger. This section provides a brief introduction to this interface.

Debugger Modes

The Apex debugger can be configured to behave in one of two modes for the display of source code: either through one of the editors or through its own source pane in the debugger window. You can configure the default source display method that's used when the debugger starts up. You can also toggle between them during a debugging session.

Using an Apex editor to display source allows you to retain the full capabilities of the editor while you're debugging. For example, you can perform Summit/CM operations, compilation, or editing operations during a debugging session.This display mode is called editor mode. It is the default.

The debugger's source display is optimized for debugging. It doesn't provide facilities for editing, compilation, or source control, for example. It does provide extra features specifically designed for debugging. For example, it contains source indicators that show where breakpoints are set. This mode is called Show Source mode.

There are several ways to configure the debugger mode:

Once you are in the debugger, you can easily switch modes using the View > Show Source command which toggles between the two modes.

The Visit Editor button displays the currently visible source in the language editor if you are in Show Source mode.

If an external editor is being used, when source code is automatically displayed, the debugger replaces the editor window with another editor window containing the current Ada unit or C/C++ file. This means if the debugger has displayed a Ada unit or C/C++ file, the debugger will replace that Ada unit or C/C++ file when another becomes the current Ada unit or C/C++ file. If you want to keep the original editor window containing a particular Ada unit or C/C++ file, choose the Debug > Keep command in the editor window.

Debugger Windows

There are several ways to open the Debugger window illustrated in Figure 1. One way is to follow these steps:

1 . Open an editor window.

2 . Choose the Window command from the Debug menu. The window illustrated in Figure 1 is displayed.

Apex opens a cascading menu.

3 . From that submenu, choose the Main Window command.

Figure 1 Debugger Window.

The Debugger Log window is the main Apex debugger window. When you conduct a debugging session, all interactions with the debugger are displayed in a sequential log in this Debugger window.

The section below the log window is called the Command Pane. This area can be used to enter debugger commands through the keyboard. These commands are listed in "List of All Commands" on page 24.

It is also possible to display information about the current program being debugged in a status line at the bottom of the Debugger Window. To display the Status Pane, select the View > Show Status Pane command. A new area will appear at the bottom of the window containing the following information about the current program:

An additional window is also available for display within the main Debugger window. This window is called the Source pane and is illustrated in Figure 2.

Figure 2 Debugger Source Window

The Source pane is used to display program source text. Use of this window allows you to do all your debugger operations within the Debugger Window, without using an external editor.

This program source can either be in regular source mode or in disassembly mode. Source mode is the default. In disassembly mode, the source window contains disassembled machine instructions, interspersed with source code, if available. Toggle between source and assembly mode by selecting the Disassembly button on the Toolbar or by positioning your cursor in the source window and entering I (capital I).

To toggle the display of the Source, Status, and Command Panes from within the debugger, use the View menu selections View > Show Source, View > Show Status and View > Show Command Pane. If you are in Show Source mode, you can toggle into editor mode by deselecting the View > Show Source command. You can also display the editor window using either the Visit Editor button or the Navigate > Visit Editor command.

Other Debugger Windows

You can also open several other kinds of debugger windows from the Debug > Window submenu. They are listed and described in Table 1.

Each of these windows is discussed in more detail in both the online reference and in the sections of this manual that discuss the topics the window is associated with.

Table 1 Kinds of Debugger Windows
Window
Purpose
Debugger window Debugger Log Window
Displays a log of commands executed in the debugger, along with other information such as values displayed and exceptions. If the Source pane is also being displayed, displays the source code at the current debugger execution location. This window also provides an area for entering debugger commands through the keyboard.
Stack window
Displays the current call stack with the current frame displayed at the top.
Breakpoints window
Displays all the currently defined breakpoints. The window has an active area that displays the active breakpoints and an inactive area that displays the inactive breakpoints.
Exceptions window
Displays the current catch and propagates exception-handling requests.
Tasks window
Displays the tasks composing the currently running program.
Registers window
Displays the registers and their current values.
Floating Point Registers window
Displays the floating point registers and their current values.
Memory window
Displays the contents of specific memory locations.
Object Display Window
Displays and updates the values of expressions in the current context.
Programs Window
Allows the control of multiple programs from the debugger.
Input/Output window
Accepts program input and displays program output; this window is automatically displayed when the direct input and output to an xterm option is selected in the Run dialog box displayed by the File > Run command. For more information see Windows > Input Output.

Help!

An extensive online help facility is available with the GUI debugger. To access this help facility, use the Help > On Context command. When you select this command, the cursor becomes a question mark. Place the question mark on any menu item or button you wish to find out about and click. The online reference information for that entry will be displayed. In addition, an online tutorial is available by selecting the Help > Tutorial command. You can also access any other Apex document by selecting the Help > Manuals command.

Entering help in the Command Pane will provide access to this document.


The Debugger's Command-Line Interface

Normally the debugger is invoked through the Apex File > Run or File > Debug command. It is, however, possible to invoke the debugger directly, without the GUI. Do this by using the rdb command.

If the rdb command is used, the debugger can be run in either line-mode or screen-mode. Line-mode is a more traditional interface. The screen-mode interface provides a more convenient interface for most people. Every function available in line-mode is also available in screen-mode. Screen mode is described in detail in Screen Mode Operation,

Invocation

rdb is a symbolic debugger for Ada and C/C++ programs, compiled with the -g option.

Note: For Sun Solaris C/C++, the -xs option is also required. For example,

For Native systems, invocation options to the program being debugged can be specified at debugger invocation. All command line options that follow the name of the executable are assumed to belong to the program being debugged.

The -r option provides a means to disambiguate options to the debugger and options to the executable file as they are interpreted by the shell on subsequent invocations of the debugger. The -r option initializes set run shell_arguments to a string made up of the executable_file and the executable_file_options enclosed in quotes. Enclosing shell commands that pertain to the executable file within the quotes, (output redirection for example) assures that they are not interpreted by the shell to apply to the debugger itself.

Any single unit or token on the command line can be up to 511 characters long.

If an argument string in the invocation of the program being debugged contains shell wildcards, it is expanded by the shell. If this expansion fails because there is no matching file, the original unexpanded argument string is passed to the program. This invocation is consistent with the Bourne shell and C shell when nonomatch is set.

Error output from globbing is checked for. If there is error output, a diagnostic is displayed as well as the argument that caused it. The original string is then passed to the program as the argument. This is also consistent with nonomatch set in the Bourne and the C shells.

Detailed descriptions of interactive rdb commands are provided in this manual, which is also available online.

Use the quit command to leave the debugger and return to the shell.

Syntax
Arguments

  • executable_file

    Name of file to execute and debug. If executable_file is not specified, the debugger searches for the default. If only a root filename is given (foo, as opposed to /vc/sbq/foo), the debugger searches the directories on the PATH environment (exported) variable for an executable file foo just as the shell does. Note that if "." is not on your Adapath (Ada) or search path (C/C++), you must enter rdb ./foo.

  • executable_file_options 

    Command line options that pertain to the executable_file being debugged. All command line options that follow the name of the executable are assumed to belong to the program being debugged.

    Invocation File

    In addition to the invocation line, you can supply parameters to rdb using an invocation file. These are discussed under the state command. Debugger state files are also know as "dbrc" files, as they have a .dbrc extension.

    An invocation file can contain any arbitrary debugger command. The invocation files are read in just before the debugger issues its first prompt (actually, right before any -i specified input file, which happens before the first prompt).

    Start-up Environment

    The debugger establishes the debugging environment when it starts up. The screen displays certain key parameters to verify what and where it is debugging.

    Redirecting Debugger Input and Output

    Normally the debugger reads from the terminal. By using the following redirection options to rdb, redirect standard input, standard output and standard error to a file.

    < filename
    Direct input to the debugger from filename
    > filename
    Direct output from the debugger to filename.
    >& filename
    Direct debugger output and error messages to filename.

    Syntax of Debugger Commands

    Most debugger commands are of the form: keyword parameters.

    In line mode, debugger keywords are not case sensitive. For example b 357, set breakpoint at line 357 can be entered also as B 357. However, certain identifiers, pathnames and C variables for example, are case sensitive.

    In screen mode, due to several special cases, debugger keywords are case sensitive. For example:

    Table 2 Case Sensitive Debugger Keywords
    B
    (break at procedure) vs. b (break at line)
    C
    (change window size) vs. cs, ct, cu, cd, cb (call stack commands)
    G
    (move to the bottom of the view) vs. Control-G (print the file and line)
    H
    (help lines) vs. h (move cursor left)
    P...p
    (to print dotted names) vs p (print simple name)

    In line mode, enter a list of commands on a single line separated by semicolons (except commands with parameters that the shell interprets). In screen mode, precede a list of commands with a colon.

    Line-mode commands execute when Return is pressed. The single exception is a breakpoint command followed by a block of commands as illustrated here. The breakpoint is set after the final Return after the end keyword.

    The debugger uses your language syntax for comments: characters between the double dash (--) (Ada) or double slash (//) (C/C++) and Return are ignored.

    While in line mode, RETURN repeats the most recent of several commands (o, oi, i, ii, s, si, l,li, / ?). Debugging a program with an r (run) or g (go) command clears RETURN until one of the repeatable commands is used again. Each command that repeats in this way is marked in the documentation with the phrase `RETURN repeats.' In screen mode, repeat the previous command line with a period.

    In screen mode, you can protect yourself from accidentally restarting the program by setting the debugger safe parameter to on (set safe on). When this parameter is set, any letter which will restart the program must be typed twice. For example, rr must be entered to rerun the program and ss to single step.

    You can enter a number as either decimal or hexadecimal. If the leading digit of a number is a zero, the debugger assumes it is a hexadecimal number (0123 or 0F2).

    When a name can be either a debugger keyword or a variable name, the debugger interprets it as a keyword. Precede the name with a backslash (\) to force the debugger to interpret it as a variable.

    Frequently, the documentation for the debugger refers to the Interrupt key (Intr). The system command stty allows this function to be assigned to any convenient key (often Control-C). The Interrupt key halts the program being debugged if it is running, or the debugger's current operation. The debugger responds immediately to the Interrupt key with a prompt for the next command.

    Control characters (for example, Control-Z) have their usual meaning.

    Line Editing/Command History

    The debugger supports line editing functions that enable the user to make simple changes to a command before transmitting it to the debugger. In addition, the debugger supports a command history mechanism that recalls a previous command for editing and execution.

    The best way to learn about the line editing and command history features of the debugger is to try them. We recommend getting into a debugging session and typing a few commands. Then try out the features described in the following sections.

    Line editing and command history only apply to debugger commands entered in the non-GUI debugger (or the Command Pane of the debugger GUI). Window control commands and debugger commands that are entered directly in screen mode cannot be line edited and are not saved in the history buffer.

    Command History

    When you transmit a command to the debugger by typing Return, the debugger remembers it (unless it is exactly the same as the previous command). The debugger has a 2048 character circular buffer to save the most recent Command Line Pane commands. Since debugger commands are typically under 10 characters, this buffer holds about 200 of the most recent commands.

    Two line editing commands are specific to command history:

    k
    Go backwards in history one command.
    j
    Go forward in history. Only use j after at least one k.

    Enter these two commands when line editing a debugger command (but not when in insert mode). Every time you type a k you go back one command. That command is displayed at the current prompt with the cursor at the right of the command. If you then type a Return, the command is submitted to the debugger. Alternatively, use any of the line editing commands to change the command, before typing Return to submit it to the debugger.

    Line editing

    When you enter a command to the debugger, you are in one of two modes, insert or edit. Normally you are in insert mode with the cursor at the end of the command line. Each character you type is added to the command at the end. The two most common line editing commands used in insert mode are "erase" (usually Control-H) to backspace over the most recent character, and "kill" (typically Control-U) to erase the entire line. The debugger uses the user stty "erase" and "kill" characters to perform these functions. The operating system stty command displays the current erase and kill characters.

    To leave insert mode and enter edit mode, the Escape key is used. This moves the cursor back one character, placing it over the last character inserted.

    Whether you are in edit or insert mode, whenever you type a Return, the entire line is transmitted to the debugger, even if the cursor is positioned in the middle of the line. In other words, what you see is what is sent to the debugger. Here is a list of the available line editing commands:

    Table 3 Line Editing Commands
    Command
    M
    Meaning
    j
    e
    Go ahead (down) in history
    A
    e
    Go to end of line and enter insert mode
    a
    e
    Enter insert mode after character under cursor
    k
    e
    Go back (up) in history
    I
    e
    Move cursor to beginning of line and enter insert mode
    0
    e
    Move cursor to beginning of line
    ^
    e
    Move to first non-white space on line.
    c {motion}
    e
    Change text [see "motion"]
    C
    e
    Change rest of line, from character under cursor
    N
    e
    Search in the opposite direction in history for previous string.
    stringESC\
    e
    Complete string with name visible in current scope that begins with string. Beep sounds if 0 or >1 matches found. Note that name completion for file names is not supported.
    n
    e
    Search in same direction in history for previous string.
    x
    e
    Delete character underneath cursor
    d {motion}
    e
    Delete text [see "motion"]
    D
    e
    Delete rest of line, from character under cursor
    Return
    b
    Transmit the current line to the debugger
    ESC
    e
    End insert mode (or CHANGE mode) -- switch to edit mode
    $
    e
    Move cursor to end of line
    i
    e
    Enter insert mode before character under cursor
    Control-H
    i
    Erase last character, prints Backspace-blank-backspace
    Control-U
    i
    Kill entire line typed so far
    Control-V
    i
    Literalize next input character
    stringESC=
    i
    List all names in current scope that start with string. Beep sounds if no matches are found.
    string(#)
    i
    Complete the name beginning with string using the # (as produced by the LS_NAMES command) for the name.
    b
    e
    Move cursor to previous word
    h
    e
    Move cursor one position left
    l
    e
    Move cursor one position right
    w
    e
    Move cursor to next word
    r char
    e
    Replace one character underneath cursor
    Control-R
    i
    Reprint most recently typed in line
    ?string
    e
    Search backward in history for the most recent command that contains string.
    /string
    e
    Search forward in history for the next command that contains string.
    Control-W
    i
    Erase most recently typed word
    Control-J
    i
    Erase most recently typed word

    The "M" [mode] column

    i = Command available in insert mode
    b = Command available in both modes
    e = Command available in edit mode

    Motion

    Select one of the following characters as a motion character for the CHANGE or DELETE editing functions. The motion character determines what changes.

    w
    From the cursor through the rest of the word
    b
    From the beginning of the word to the cursor
    0
    From the beginning of the line to the cursor
    ^
    From the first non-white space of the line to the cursor
    $
    From the cursor to the end of the line

    Additional Notes

    1 . For the change commands (CHANGE and CHGROL), you enter change mode after typing the command. The change area is marked by a dollar sign ($) on the right end and the cursor on the left end. This entire area is replaced by what you type. If what you type is shorter than the change area, then the remainder of the change area is deleted. If what you type is longer, then the remainder of the line is pushed to the right to make room.

    2 . The h, j, k and l characters give the directions left, down, up and right respectively. If you view the history as a page of text, then the j key moves up the page and the k key moves down the page.

    3 . If you type ?p in edit mode, the last command stored in history that has a p in it is matched. Note that the command does not have to start with a p. If no match is found, a beep is sounded. Use the / in edit mode to search forward in history. Note that N and n in edit mode must follow the completion of either a / or a ? command.

    4 . In addition to ERASE KILL, WERASE and REPRINT are character sequences that the debugger inherits from your current stty settings.

    5 . The command stringESC= provides the ability to find all names in the current scope that begin with the string entered before the ESC. For example, if you are debugging "Hello World", the following can be entered.

    6 . An additional feature uses the numbers produced from the stringESC= command to quickly change the command line. The current string is completed to the string listed by the number chosen using the string(#) command. For example, after issuing the p pESC= command, you may wish to continue the p p command with put'4 (number 3 in the list). You can do this by entering the following at the spot where the cursor is located:

      (3) 
      

      The full command appears as >p p(3).

      After entering the above and pressing Return, the command line changes to

      >p put'4
      

      and you are back in insert mode again.

    Note: Matching is done on the names of the subprograms or variables that are visible, not by the name of the package. In the example above, the list comes from matching the letter p. You would not see the entries in the list that match t for Text_Io if you typed tESC=. The name of the package is printed in the list for your convenience.

    Screen Mode Operation

    The debugger supports a screen-oriented interface in addition to the more traditional line-oriented interface.

    Invocation

    To use the screen interface, either invoke the debugger with the -v option,

    or use the vi command from line mode.

    To switch from screen mode to line mode, type the screen command Q.

    Windows

    In screen mode, the debugger divides the screen into three windows. The top window is called the source window. It goes from the top of the screen to the dashed line and is used for program source text. The window below the dashed line is called the command window. It displays command input to the debugger, text input to the program being debugged and debugger/program output. The last line on the screen is called the error window and displays error messages from the screen-mode interface, patterns, etc. Output that appears in the error window does not appear in a log file.

    The top two windows display a portion of a potentially larger area. For example, the source window displays part of a source file. Move this window to display a different part of the same source file or display part of a different source file.

    The debugger keeps the last 750 lines of text that are displayed in the command window in an internal history buffer. Typically, the command window is positioned to display the most recent interactions (the end of the history buffer). However, this window behaves just like the source window in that you can use window control commands to view previous history.

    The command window is paged automatically. If output from either a single debugger command or the user program scrolls off the top of the window, the output stops and --More-- is displayed on the last line. The available responses are listed in the following table.

    When the screen interface is invoked, the source window is 2/3 of the available screen size, the error window has 1 line and the command window has the remainder of the screen. Change the size of the source and command window at any time using the C command. The debugger remembers the most recent settings over subsequent Q and vi commands.

    Table 4 Paging Responses in Screen Mode
    SPACE
    Print the next window of text.
    Return
    Print next line.
    g
    Enlarge command window (at expense of source window). Windows are restored at next debugger command or by the window control command, C.
    q
    Do not display remaining output but enter it into history buffer and write it into your current log file.
    p
    Turn paging off for both debugger commands and program output. Paging is turned back on with the start of the next debugger command. Paging can be permanently turned off when not responding to --More-- using the set page off command.
    x
    Abort debugger command. (Stop program output by stopping the program with Control-C.)

    Entering Commands

    Screen-mode commands are those commands that are processed directly by the screen interface. These commands are not followed by Return —— they execute immediately when the entire command is typed. Precede some screen commands with an optional numeric argument.

    Two classes of screen commands exist. The window control commands allow manipulation of the window interface. The immediate debugger commands are recognized by the screen interface and passed directly to the debugge

    The window control commands are applied to the window that contains the cursor. The comma (,) command moves the cursor from source window to command window or the reverse.

    Instruction and Source Sub-modes

    In screen mode, the debugger supports two sub-modes, instruction and source. The I (uppercase i) command toggles the sub-mode, switching from one to the other. In source mode, the source window displays program source code and the s, i, and o commands single-step at the source statement level.

    Source mode is the default. In instruction mode, the source window contains disassembled machine instructions, interspersed with source code, if available. Although the source window contains machine instructions, control it with all regular debugger commands. In this mode, the s, i, and o debugger commands are interpreted as their machine instruction counterparts, the si, ii, and oi commands. The b command is interpreted as bi, setting a breakpoint at the machine instruction under the cursor. All searching and window control commands are available.

    Screen Prompt

    Columns 1 and 2 of the dashed line separating the source window from the command window show the screen-mode prompt, *. The prompt alternates between these two columns and is displayed only when the debugger is awaiting a command. Typing input at any other time is treated as type-ahead and/or input to the program under debug

    The * alternates between the two columns to indicate that a change occurs in certain, otherwise non-changing, situations. For example, if stopped at a breakpoint in a loop, typing g returns to the same breakpoint. The only change on the screen is the position of the *.

    Alert Frequency

    The number of instructions stepped appears on the dashed line. This number appears after a step (s) or advance (a) command is entered. The default setting for the initial display is 1000 but change it with the set step_alert number command. After the first 1000 machine instructions are stepped, the alert frequency number on the dashed line is incremented each time 100 additional instructions are stepped. Change the default value of 100 with the set alert_freq number command.

    Help

    The screen mode H command displays a line of help text in the error window. This is one of several lines of help text that summarize all screen mode commands. The next help line is displayed each time the H key is pressed.

    Window Control Commands

    Window control commands control the screen interface. The pattern-matching commands / and ? move the cursor to the bottom of the screen and prompt for the pattern. To terminate the pattern, press either ESC or Return.

    You can precede some commands with an optional number. When number is given for a Control-D or Control-U command (scroll up or down), that number is used with all subsequent Control-D and Control-U commands until a new number is specified. The initial value of number is one-half the size of the window.

    Table 5 lists the window control commands. Note that window control commands are case sensitive.

    Table 5 Window Control Commands
    Control-B
    (backwards) Move backward one full window
    [number]C
    (change) Change the number of lines in the window; no number restores original sizes
    [number]Control-D
    (down) Scroll down 1/2 window or number lines
    Control-F
    (forward) Move forward (down) one full window
    Control-G
    Print the name of file displayed in source window
    [number]G
    (go to) Move to bottom or specified line of file
    [number]h or <-
    Move left one or number columns
    H
    Display the next one-line help message
    I
    Toggle between instruction and source sub-modes
    [number]j or t
    Move down one or number lines
    [number]k or s
    Move up one or number lines
    [number]l or ->
    Move right one or number columns
    L
    Insert a "." on every breakpointable line. The "." appears between the source line number and the source text. Toggle this display by typing L. [Default: on]
    mark letter
    Mark a location in either the command or source window. You can return to this location using the 'letter command. Note that letter must be lowercase. There is a separate set of marks for the command and source windows. The previous set of marks is invalidated by changing files in the source window or changing the disassembly-mode with the I command. Since a limited number of lines are stored, some marked lines may become lost and the associated mark invalidated.
    n
    Repeat the previous / or ? search
    Q
    Leave screen mode; enter line mode
    w
    Move forward one word.
    yy
    Yank line at cursor location (in either window) to command line (Escape required from insert mode to line-edit mode)
    [[
    Move backward in the source file to the next function, class (C/C++), procedure, package, task (Ada) or declare block.
    ]]
    Move forward in the source file to the previous function, class (C/C++), procedure, package, task (Ada)or declare block.
    Control-R
    redraw) Redraw all windows (clean up display)
    [number]Control-U
    (up) Scroll up 1/2 window or number lines
    / pattern
    Search forward for pattern
    ? pattern
    Search backward for pattern
    :
    Enter a debugger command line
    .
    (period) Repeat the previous debugger command line
    ,
    (comma) Move to the other window
    0
    zero) Move to beginning of line
    ^
    Move to first character on line that is not whitespace (tab or blank)
    $
    Move to end of line
    %
    Move forward or back to matching parenthesis or brace. In addition, in Ada, % finds the matching end when the cursor is placed on: if, loop, for, while, case, record, select, function, procedure, package or task. Likewise, % moves the cursor back from end if to the corresponding if, back from end procedure_name to the corresponding procedure, etc.
    *
    Move the cursor to the current home position
    'letter
    Return to location previously marked with mark letter command. Note that this command works across files.
    '
    Return to the previous destination of a G, /, ?, [[, ]]. % or another '' command. The debugger motion commands reset the destination of the '' command. Thus, typing the following sequence of commands returns you to the line reached by the o command.

    o
    /
    function
    `
    '
    Entering another ' returns you to the line reached by searching for the string "function".

    Immediate Debugger Commands

    Table 6 lists shows the immediate debugger commands. Enter these commands without a preceding : or a following Return in screen mode. In addition, you can enter any line-mode debugger command by typing a colon first. In response to the colon, the screen interface scrolls one line up the command window, positions the cursor on the bottom line of the command window and prompts with a colon. Now enter any line-mode debugger command followed by Return. After each such debugger command, the cursor returns to the source window.

    Table 6 Immediate Debugger Commands
    b
    Set a breakpoint on line containing cursor
    [number]B
    Set breakpoint at subprogram (or qualified subprogram) name under cursor (using number to disambiguate an overloaded name)
    cb
    (call bottom) Move current position and frame to bottom of stack
    [number]cd
    (call down) Move down one frame or number frames on call stack
    [number]cs
    (call stack) Display entire call stack or just number frames
    ct
    (call top) Move current frame and current position to top of stack
    [number]cu
    (call up) Move up one frame or number frames on call stack
    d
    Delete breakpoint at line containing cursor
    g
    (go) Continue program execution
    i
    Step into procedure, over parameter function calls
    o
    Step to next source line over call statements
    p
    Display value of variable underneath cursor. If the variable is a dotted name, the initial scan goes in reverse. All subsequent scans go to the right.
    P...p
    Delimit the expression under the cursor (for use with p)
    P...a
    Print variable.all (Ada only)
    P...*
    Print *variable
    P...y
    Yank variable to command line as text. The text appears on the command line preceded by a :p.
    r
    (run) Start or restart program execution.
    s
    (step) Step to next source line going into subprograms.
    yy
    Yank line at cursor location (in either window) to command line (ESC required from insert mode to line-edit mode).
    [number]Control-]
    Execute debugger v command for name of any declarable Ada entity under cursor (using number to disambiguate an overloaded name). Placing the cursor anywhere within the first identifier of a qualified name and entering Control-] takes you to the declaration of that qualified name. Note that each time you Control-] in another procedure, your current location is pushed onto a tag stack for use with the Control-T command. Note that for dotted names, Control-] scans in reverse.
    Control-C
    Interrupt the current debugger operation.
    Control-T
    Return to the position where you last entered Control-] or the v (visit) command.

    Screen Interface and set output

    The set output [pty|tty||filename] option displays input and output from the program being debugged in screen mode without overwriting the source window. With set output pty, the debugger intercepts the program output that is displayed in the command (lower) window. This is the default. Terminal input required by the program is taken from the lower window. With set output tty, the output from a program is displayed on the screen beginning at the cursor location.

    When debugging programs that send cursor-positioning strings to the terminal, it is useful to alternate between screen and line mode or type :Return as many times as necessary to clear the bottom portion of the screen of all cursor-positioning strings and then refresh the display with Control-R.


    List of All Commands

    This section contains a list of all the commands that can be entered using the non-GUI debugger or the Command Pane of the debugger GUI.


  • Rational Software Corporation 
    http://www.rational.com
    support@rational.com
    techpubs@rational.com
    Copyright © 1993-2002, Rational Software Corporation. All rights reserved.
    TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS