Chapter 1. Main View Window

This chapter provides an overview of the main menus shown on the Main View window.

Primary Components of the Main View Window

The Main View window is shown in Figure 1-1.

Figure 1-1. The Main View Window

The Main View Window

The Main View window contains a menu bar, from which you can perform a number of actions and launch windows. The screen and menu bar contains the following items, which are discussed in detail in this chapter:

When you start the Debugger with an executable file, the Main View window displays, loaded with source code, ready to execute your program with your specified arguments. Most of your debugging work takes place in the Main View window, which includes the following main areas:

  • A menu bar for performing debugger functions.

  • A control panel for specifying and controlling program execution.

  • A source code display area which displays the code for the program you are debugging.

  • A source filename field which tells gives you the path to the file displayed in the source code display area.

  • A status area for viewing the current status of the program.

  • The Debugger command line in which to enter debugging commands.

The Main View window contains the following items:

  • Command text field: Displays full pathname of the executable file that you are currently debugging, including any run-time arguments.

  • Debug button: Allows you to toggle among various modes. Right-click on the Debug button to display the State Indicator menu where the following mode choices are available:

    • Debug runs the Debugger in Debug mode with no performance tools enabled.

    • Performance mode causes performance data to be gathered and instrumented code to be generated for performance analysis while using the Debugger.

    • Purify mode activates the Purify memory corruption analysis tool. The code displayed in the Main View window, Source View window, and so forth is code generated by Purify. (This option appears only if Purify is installed on your system. Purify is not an SGI product nor is it part of the WorkShop package. It is a product of Rational Software and is neither available from nor supported by SGI.)

  • The lock (Stay Focused/Follow Interesting) button: If the lock icon is locked, it indicates that the focus of Main View will attempt to stay focused on this thread. If the lock is unlocked, the debugger follows the interesting thread.

  • All/Single button: If set to All, the Cont, Stop, Step, Next, and Return actions apply to all processors or threads. If set to Single, then only the currently focused process or thread will be acted on.

  • Cont button: Continues execution of the current process or all processes in the program. When you click on the Cont button, the program runs either to a breakpoint exception or to termination. This button is active only after the running process(es) has stopped. If the program has not been run or has been killed, the Cont button is grayed out. If the target program has not yet started executing, use the Run button to start execution.

  • Stop button: Stops execution of the current running process(es). This button is valid only when a process is running; otherwise the button is grayed out. Traps can also be set to stop the program at a specific location or on a particiular condition.

  • Step button: Executes the code involving a single source line of the current process. If a function is encountered in the source line, or is the source line in a subroutine call, the process steps into a function or subroutine call and stops at the first executable line in the funciton or subroutine. The Next button can be used to continue to the next source line in the current file. If a trap is encountered while executing the step into command, the process is stopped where the trap was fire. The Step button is active only after the running process has stopped; otherwise the button is grayed out.

    When you right-click on the Step button, a menu pops up to allow you to choose the number of source lines to be stepped. If you choose the N menu entry, a dialog window is opened to allow you to enter a step value.

  • Next button: Executes the code involving a single source line of the current process. The current process continues to the next source line in the current file, and does not count any statements in functions that may be encountered in the source file. If the source line is a subroutine call, the process stops at the next source line in the current file. The Step button can be used to step into a function or subroutine call and stop at the first executable line in the function or subroutine. If a trap is encounrtered while executing the step over command, the process is stopped where the trap was fired. The Next button is active only after the running process(es) has stopped; otherwise the button is grayed out.

    When you right-click on the Next button, a menu pops up to allow you to choose the number of source lines to be stepped. If you choose the N menu entry, a dialog window is opened to allow you to enter a step value.

  • Return button: Continues execution of the process until the current function being executed returns. The process is stopped immediately upon returning to the calling function. All code within the current function is executed as usual. If a breakpoint is encountered, the action is canceled and the process is stopped where the breakpoint was fired. You can use this button only after the running process(es) has stopped; otherwise, the button is grayed out. This action is not allowed if the executable is instrumented for performance analysis.


    Note: For IRIX 6.5, this command button always returns all pthreads.


  • Sample button: Allows you to collect process state data to be used by the Performance Analyzer for program evaluation. You can use this button only when the process(es) is running and the Enable Data Collection mode is set on the Performance panel; otherwise, the button is grayed out. See the ProDev WorkShop: Performance Analyzer User's Guide for details.

  • Print button: Prints, in the Source View window, the value of any highlighted text, or the source pane of the Main View window.

  • Kill button: Kills the currently running process or all running processes in your debug session by sending the process(es) the equivalent of a kill -9 signal. You can use this button if the process(es) is running or stopped; otherwise the button is grayed out.

  • Run button: Runs the program that you are currently debugging or all programs. After the initial run, allows you to rerun the program(s) while maintaining any breakpoints and command line arguments you have set.

  • Status area: Displays information about the process that you are debugging, such as process id, thread id, function name, list of arguments, location of the PC, and so forth,

  • Source Code area: Displays the source code for the program that you are currently debugging.

  • Annotation column: Clicking in this area displays information specific to a line number, such as breakpoints, location of the PC, and so forth.

  • File text field: Displays the name of the file shown in the source code area.

    The down arrow indicates that a pulldown menu is available. The menu has a list of files that have recently been accessed and displayed. Clicking on a menu item displays the corresponding file in the Source View display area.

  • Command line area: Area of the Main View window where you can enter Debugger commands and view line-mode debugger message, and in which Debugger messages are displayed.

  • Show/Hide annotations button: This button is visible only when you run or load a performance experiment (see the ProDev Workshop: Performance Analyzer User's Guide for more information on the performance tools). This is a toggle button that shows or hides performance related annotations.

Admin Menu

The Admin menu in the Main View window performs administrative and general management tasks dealing with processes, windows, and user preferences. The Admin menu provides the following selections:

  • Library Search Path: Controls where the Debugger looks for DSOs when you invoke the Debugger on an executable or core file. The Library Search Path dialog allows you to reset the LD_LIBRARY_PATH and _RLD_ROOT environment variables. You can also reset _RLD_LIST to control the set of DSOs that are used by the program. See the rld(1) man page for more information on these variables. Any changes you make to these variables are propagated into Execution View when you run the program.

    There are two ways to open this dialog. First, select Admin -> Library Search Path from the Main View window menu bar, or the Library Search Path dialog opens automatically if you invoke the Debugger on an executable or core file and it is unable to find all of the required DSOs. In this case, an annotated list of required DSOs displays at the top of the dialog box with such status messages as OK, Error: Cannot find library, or Error: Core file and library mismatch (which indicates that the Debugger found a DSO that did not match the core file). Below this list are three to nine fields in which you can modify the value of the corresponding named environment variable.

  • Remap Path: Opens a dialog that allows you to enter a new pathname.

  • Multiprocess Explorer: Displays the Multiprocess Explorer window, which allows you to control processes and threads. You should note that if you exit from Multiprocess Explorer, you exit from your debugging session. For additional information about Multiprocess Explorer, refer to “Multiprocess Explorer” in Chapter 2.

  • GLdebug: Provides a toggle to turn on GLdebug. GLdebug is a graphical software tool for debugging application programs that use the IRIS Graphics Library (GL). GLdebug locates programming errors in executables when GL calls are used incorrectly.

  • Attach/Switch Process: Changes the current process or attaches to a process. You are queried for the new process ID. You can select one from the list of items presented, type one in or paste one in from another window. Switching processes changes the session.

  • Load/Switch to Executable: Changes the current executable or loads an executable. This option also allows you to debug a different core file.

  • Detach: Releases the process from the Debugger. This allows you to make changes to the source code. You must detach the process before you recompile the program.

  • Load Settings: Allows you to use the previously saved preference settings from a file you choose in the Load Settings dialog.

  • Save Settings: Allows you to save the current preference settings to an initialization file used when the Debugger is first started, or any file you choose through this dialog. These can include such items as window sizes, current views, window configurations, and so on.

  • IconifyIconifies all session views.

  • Raise: Brings all session view windows to the foreground and displays any iconified windows.

  • Launch Tool: Allows you to run other WorkShop tools. You can switch to the other tools by selecting Build Analyzer, Static Analyzer, Performance Analyzer, or Tester. Selecting Debugger allows you to start another debugging session. If you have ProDev ProMP (formerly called WorkShop Pro MPF) installed on your system, the Parallel Analyzer selection is also available.

  • Close: Closes the Main View window.

  • Exit: Closes all views in the session and terminates the session.

Views Menu

The Views menu in Main View window provides the following selections for viewing the process(es) and their corresponding data:

  • Array Browser: Displays values from an array or array-slice in a two-dimensional spreadsheet and optionally in a three-dimensional representation; that is, a bar graph, surface, multiple lines, or points in space. These help you pick out bad data more readily. Arrays can contain up to 100 x 100 elements.

  • Call Stack: Displays the call stack along with parameters to the calls. If you double-click an entry in the stack, you switch the current context to that entry and you can check the state of variables.

  • Data Explorer: Displays data structures in a graphical format. You can de-reference pointers by double-clicking.

  • Data View: brings up a Data Window.

  • Disassembly View: Displays assembly code corresponding to the source code.

  • Exception View: Displays an Ada-specific window used for exception handling.

  • Execution View: Displays the iconified Execution View window, which handles the input and output of the target process.

  • Expression View: Evaluates expressions in Fortran, C, or C++. To enter an expression, select it in the source code display and paste it into the Expression View field, using the middle mouse button.

  • File Browser: Displays a list of source files and library routines used by the current executable. Double-click a source file in the list to load it directly into the source display area in Main View or Source View windows. The Search field allows you to find files in the list quickly.

  • Memory View: Displays the value at a given memory address.

  • Multiprocess Explorer: Displays a window which allows you to control processes and threads.

  • Process Meter: Monitors the resource usage of a running process without saving the data. (Used with the Performance Analyzer.)

  • Register View: Displays the values stored in the hardware registers for the target process.

  • Signal Panel: Displays the signals that can occur. You can specify which signals trigger traps and which are to be ignored.

  • Source View: Displays source code. Allows you to set traps, perform searches, and inspect source code without losing information in the Main View window.

  • Syscall Panel: Allows you to set traps at the entry to or exit from system calls.

  • Task View: Brings up an Ada-specific view that provides task and callstack information for processes.

  • Trap Manager: Allows you to set, edit, and manage traps. The Trap Manager is used by both the Debugger and the Performance Analyzer.

  • Variable Browser: Displays values of local variables and parameters for the current context.

  • X/Motif Analyzer: Provides you with specific debugging support for X/Motif applications. There are various examiners for different X/Motif objects, such as widgets and X graphics contexts, that might be difficult or impossible to inspect using ordinary Debugger functionality.

Query Menu

The Query menu allows you to perform some of the queries available in the Static Analyzer. These queries are convenient if you have previously built a cvstatic fileset. However, if you need to build the fileset from scratch, the process becomes more involved. For complete information about using the Static Analyzer, see the ProDev Workshop: Static Analyzer User's Guide and the cvstatic(1) man page.

With a current fileset, you can double-click any defined entity in the source code, select the Where Defined? option from the submenu appropriate to its type, and the source code display area scrolls to the location where the item is defined.

Source Menu

The Source menu in the Main View window provides the following selections to manage source code files:

  • Open: Loads a source file.

  • Open Recent: Provides you with a popup dialog that gives you a selection of recently-opened files from which to choose.

  • Save: Records changes made during the debugging session to the source file. You must first select Make Editable, which appears in the Source menu when the file is read-only.

  • Save As: Records changes made during the debugging session to the source file under a different filename. You must first select Make Editable, which appears in the Source menu when the file is read-only.

  • Save As Text: Records the information in the display area as a text file.

  • Insert Source: Inserts the text of a file within your current file. You must first select Make Editable , which appears in the Source menu when the file is read-only. You must first select Make Editable, which appears in the Source menu when the file is read-only.

  • Fork Editor: Starts your default editor on the current file. The default editor is determined by the editorCommand resource in the app-defaults file. The value of this resource defaults to wsh -c vi +%d, which means run vi in a wsh window and scroll to the current line. If the editor allows you to specify a starting line, enter %d in the resource to indicate the new line number.

  • Recompile: Displays the Build View window, which allows you to compile the source code associated with the current executable.

  • Make Read Only / Make Editable: Toggles the source code displayed between read-only and writable states so that you can edit your code.

  • Search: Searches for a literal case-sensitive, literal case-insensitive, or regular expression. After you have set your target and clicked Apply (or pressed Enter), each instance is marked by a search target indicator in the scroll bar. You can search forward or backward in the file by clicking the Next and Prev buttons. You can also click an indicator with the middle mouse button to scroll to that point. Clicking Reset removes the search target indicators.

  • Go To Line: Allows you to scroll to a position in the source code by specifying a line number. Go To Line brings up a dialog box.

    You can enter a line number or use the slider at the top of the box to select a line number. You do not have to display line numbers to use this feature.

  • Versioning: Provides access to the configuration management tool, if you have designated one.

    Type the following at the Execution View prompt:

    /usr/sbin/cvconfig [rcs | sccs | ptools | clearcase]


    Note: You must have root permissions to run cvconfig.


    The Versioning submenu appears.

    Selecting any submenu option displays a shell in which you can access the configuration management tool. The following selections are available on the submenu:

    • CheckIn -- Saves the source file and checks it into the database as a new version.

    • CheckOut -- Recalls the source file from the tool's database if you have the proper authority, locks it, and makes it editable.

    • UncheckOut -- Cancels the checkout, with no changes registered.

Display Menu

The Display menu in the Main View window provides the following selections to annotate the displayed source code:

  • Show Line Numbers/Hide Line Numbers: Displays or hides line numbers in the annotation column corresponding to the source code.

  • Show Toolbar: Allows you to choose the format type for the toolbar. The options are Text Only, Icons Only, or Icons and Text. Text Only was the only format for the toolbar prior to release 2.9. Icons Only and Icons and Text are options which display icon options for more visual debugging.

  • Show Tooltips/Hide Tooltips : This menu item enables or disables the context sensitive pop-up help option. Some of the key menu items, buttons, and data entry areas have pop-up help statements attached to them to give the user hints on what to use them for or how to use them.

  • Preferences: Displays the Annotations Preferences dialog box, which allows you to show or hide column annotations and menus specific to the different WorkShop tools. If you have purchased ProDev ProMP, you can display and manipulate loop indicators. The Performance toggle displays experiment statistics. The Tester module allows you to see coverage statistics. Turning off the Performance toggle deletes the performance annotations from the Source View.

  • Hide Icons/Show Icons: Hides or displays the annotation column, which is located to the left of the source code display area.

  • Expression Evaluation: Toggles between expression evaluation or auto-evaluation of expressions

  • Show Toolbar: Toggles between showing the toolbar as icons, text, or a combination of both.

Perf Menu

The Perf (Performance) menu includes the following menu selections:

  • Select Task submenu: Allows you to choose the task for your performance analysis. You may select only one task per performance analysis run. If none of the given tasks satisfy your requirements, you can choose Custom, which brings up the configuration dialog open to the General tab. From here, you can design your own task requirements.

  • Examine Results: Launches the Performance Analyzer. For complete information about the Performance Analyzer, see the ProDev Workshop: Performance Analyzer User's Guide.

  • Configs: Brings up the configuration dialog open to the Runtime tab. The dialog opens with the Experiment Directory text field filled in with a default value. The Performance Analyzer provides a default directory named test0000. If you use the default or any other name that ends in four digits, the four digits are used as a counter and are incremented automatically for each subsequent experiment.

Traps Menu

The Traps menu offers the Set Trap and Clear Trap submenus and the Group Trap Default and Stop All Default menu options.

The Set Trap submenu offers menus for managing breakpoints and sample points. The following submenu selections are available:

  • Stop: Sets a breakpoint at a designated line in your source code. To set a breakpoint at a line displayed in the Main View or Source View windows:

    1. position the cursor on the appropriate line in the source code display area

    2. select the Set Trap submenu

    3. choose the Stop option

    The preferred method for setting a breakpoint is to click in the annotations area of the Main View window, across from the line at which you want to set the breakpoint.

  • Stop At Function Exit: Sets a breakpoint at the end of a function. To set a breakpoint at a function exit, click on the function name in the source code display area and select the Set Trap submenu, then choose the Stop At Function Exit option.

  • Sample: Sets a sample trap at a line displayed in the Main View or Source View windows. To set a sample trap:

    1. highlight on the appropriate line

    2. pull down the Set Trap submenu

    3. select the Sample option

  • Sample At Function Entry: Sets a sample trap at the beginning of a function. To set the sample trap, highlight the function name in the source code display area, then pull down the Set Trap submenu and select the Sample At Function Entry option.

  • Sample At Function Exit: Sets a sample trap at the end of a function. To set the sample trap, highlight the function name in the source code display area, then pull down the Set Trap submenu and select the Sample At Function Exit option.

The Clear Trap submenu contains selections that allow you to delete a trap on the line containing the cursor. You must designate Stop or Sample trap type, since both types can exist at the same location, appearing superimposed on each other. The following submenu selections are available:

  • Stop: Designates the stop trap type.

  • Sample: Designates the sample trap type.

The last two menu options allow you to specify the following items:

  • Group Trap Default: Interacts with Source View. If set to true, all subsequent Source View trap requests are group traps. That is, all members of the process group apply this trap. This option is the same as typing stop pgrp in filename from the command line. Default is false unless you are using IRIX 6.5 pthreads, when the implied setting is always true.

  • Stop All Default: Interacts with Source View. If set to true, all subsequent Source View trap requests apply the Stop All command to the trap. That is, whenever this trap is encountered, all other members of the process group also are stopped. This option is the same as typing stop all in filename from the command line. Default is false unless you are using IRIX 6.5 pthreads, when the implied setting is always true.

If both of the default options are set to true, it is the same as typing stop all pgrp in filename from the command line.

Fix+Continue Menu

The Fix+Continue menu offers the following menu selections:

  • Edit: Allows you to edit text using the Debugger editor.

  • External Edit: Allows you to edit text by using an external editor. The default editor is vi, but can be changed by using the Set Edit Tool pop-up menu in the Admin menu of the Status window. See “Fix+Continue Status Window” in Chapter 8, for further information.

  • Parse and Load: Compiles your modified program and loads it for execution. You can execute the modified program by clicking on the Run or Continue buttons in the Main View window.

  • Show Difference submenu: Allows you to see the difference between the original code and your modifications. The submenu options are:

    • For Function: Opens a window that shows you the differences between the original source and your modified source.

    • For File: Opens a window that shows you the differences between the original source file and your modified version.

    • Set Diff Tool : Launches the Fix+Continue Preferences Dialog that allows you to set the tool that displays code differences. The default is xdiff(1).

  • Edited<-->Compiled: Enables or disables your changes. This switch allows you to see how your application executed before and after the changes you made.

  • Save As: Allows you to save your changes to a file. You can save changes to the current source file (the default) or to a separate file.

  • Save All Files: Launches the Save File+Fixes As dialog that allows you to update the current session and save all the modifications.

  • View submenu: Allows you to change to different views. Fix+Continue supports status, message, and build environment windows. This submenu contains the following options:

  • Preferences submenu: Allows you to set your Fix+Continue preferences. It contains the following options:

    • Show Preferences: Launches the Fix+Continue Preference Dialog that displays preferences currently enabled for the session, and allows you to change the settings. The following preferences are available through the dialog:

      • External Editor Command text field that allows you to choose your text editor. The default is vi.

      • File Difference Tool text field allows you to choose the tool to use when comparing code. The default is xdiff(blank).

      • Copy Traps On Previous Definition toggle allows you to edit and parse code. When Fix+Continue copies traps from the old definition to the new one by mapping old lines to new lines. (This mapping is the same as what can be generated using the UNIX diff utility.) If Copy Traps On Previous Definition is on and the mapped line the new definition is modified, then Fix+Continue will look at the switch.

      • Copy Traps Even On Changed Lines toggle causes the debugger to copy traps onto a mapped line.

      • Continue Even If Line Has Changed toggle allows you to edit and compile code in which your program is currently stopped. Fix+Continue can continue in the new definition provided some conditions are satisfied. The line from which the program continues depending on the mapping from the line in which it stopped. In case it can continue in the new definition from a line which you have modified, Fix+Continue consults this toggle to determine whether to continue in the new or old definition. This toggle allows you to override the default behavior.

      • Warn Unfinished Edits Before Run toggle pops up a warning dialog before a run if you have unfinished edits.

      • Warn Unfinished Edits Before Continue toggle pops up a warning dialog before a continue if you have unfinished edits.

      • Save deactivated code during File Save toggle save old code. The Fix+Continue file save substitutes new definitions in place of old ones. If you want to save your original functions in the same file, this switch allows you to save the old (original or compiled) code under an #ifdef. When you compile, the old code does not get compiled. You can manually edit the source to use the old definition in any way you desire.

    • Reset To Factory Defaults: Sets preferences to the installed defaults.

    • Save Preferences: Brings up the File dialog that allows you to save your preferences to a file.

    • Load Preferences: Brings up the File dialog that allows you to load preferences from a file.

  • Cancel Edit: Takes you out of edit mode and cancels any changes you have made.

  • Delete Edits: Deletes any modifications that you made.

Keyboard Accelerators

Use the accelerators in Table 1-1 to issue Fix+Continue commands directly from the keyboard. The accelerators are listed alphabetically by command.

Table 1-1. Fix+Continue Keyboard Accelerators

Command

Key Sequence

Cancel Edit

Alt+Ctrl+q

Edit

Alt+Ctrl+e

Parse And Load

Alt+Ctrl+x


Help Menu

The Help menu provides the following options:

  • Click for Help: Provides information on the selected window or menu.

  • Overview: Provides general information on the current tool.

  • Index: Displays the entire list of help topics, alphabetically, hierarchically, or graphically.

  • Keys & Shortcuts: Lists the keys and shortcuts for the current tool.

  • Product Information: Provides copyright and version number information on the tool.

PC Menu

The PC (program counter) menu in previous releases was location on the Main View menu. As of the WorkShop 2.9.2 release, the PC option is now a dynamic menu and can be accessed by running an executable file and holding down the right mouse button on a blank area in the source file. When you do so, the following options appear:

  • Continue To: Continues the process to the selected point in the program unless some other event interrupts. Select a line by clicking on it. The process must be stopped before you can use Continue To.

  • Jump To: Goes directly to a selected point within the same function, jumping over intervening code. Then the Debugger waits for a command to resume execution. Select a line by clicking on it.