Appendix A. Debugger Reference

This chapter describes in detail the function of each window, menu, and display in the Debugger's graphical user interface (GUI). In addition, the chapter describes the Debugger commands available on the Debugger command line (see "Debugger Command Line"). Most commands are available from either interface. You can move from one to the other as you prefer.

This chapter contains the following sections:

Main View

The major areas of the Main View window are shown in Figure A-1.

Figure A-1. Major Areas of the Main View Window

Figure A-1 Major Areas of the Main View Window

The Main View contains a menu bar, from which you can perform a number of functions and launch windows. The menu bar contains the following items, which are discussed in detail in later pages:

In addition, the Main View contains the following items:

"Command" text field 


Displays the full pathname of the executable that you are currently debugging.

Debug option menu 


Allows you to conduct performance experiments using either the built-in WorkShop performance tools, or the Purify memory corruption analysis tool. The option menu choices are:

  • "Debug Only," which runs the Debugger in Debug mode only, with no performance tools enabled.

  • "Performance," which causes performance data to be gathered and instrumented code to be generated for performance analysis while using the debugger.

  • "Purify," which causes the Debugger to run the Purify memory corruption analysis tool during your experiment. The code that you view with the debugger (in Main View, Source View, and so on) is Purify code. For further information on Purify, see the Purify documents.


Note: Purify is not part of the standard debugger package; it must be ordered separately.


Continue 

Continues the execution of the current process. This command is legal only if the running process is stopped. If the program has not been run or has been killed, the Continue button is desensitized (grayed-out). If the target program has not yet started executing, use the Run command to start execution.

Stop 

Stops the execution of the current process while it is running. his command is valid only when a process is running; otherwise the command button is desensitized (grayed-out). Traps can also be planted to stop the program at a specific location or on a particular condition. See the Trap Manager for more details.

Step Into 

Executes a source line single step of the current process. If a function call is encountered, it is stepped "into." That is, the current process continues to the next source statement, even if that statement is encountered in a function that is called. The Step Over command can be used to step over function calls, then stop.If a trap is encountered while executing Step Into, the command is canceled and the process is stopped where the trap was fired. This command is legal only if the running process is stopped; otherwise the command button is desensitized (grayed-out).

When you press the right mouse button over the Step Into button, a menu pops up to allow you to choose the number of source lines to be stepped. The step value menu selections consist of "1, 2, 3, 4, 5, 10, 15, 20, N..." If you choose the last menu entry "N...", a dialog window is opened to allow you to enter a step value.

Step Over 

Executes source line single step of the current process. If a function call is encountered, it is stepped "over." That is, the current process continues to the next source statement, but does not count statements in functions that are called while stepping. Step Into can be used to step into function calls, then stop. If a trap is encountered while executing Step Over, the command is canceled and the process is stopped where the trap was fired.

When you press the right mouse button over Step Over, a menu pops up to allow you to choose the number of source lines to be stepped. The step value menu selections consist of "1, 2, 3, 4, 5, 10, 15, 20, N..." If you choose the last menu entry "N...", a dialog window is opened to allow you to enter a step value.

Return 

Continues the execution of the process until the current function that is 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 trap is encountered while executing the Return command, the command is canceled and the process is stopped where the trap was fired. This command is legal only if the running process is stopped; otherwise the command button is desensitized (grayed-out). This command is not allowed if the executable is instrumented for performance analysis.

Sample 

Allows you to manually sample the state of a process for evaluation by the Performance Analyzer. This command is legal only if the process is running and the Enable Data Collection mode is set on the Performance panel; otherwise the command button is desensitized (grayed-out).

Print 

Prints the value of the currently selected expression.

Kill 

Kills the currently running process that you are debugging by sending it the equivalent of a "kill -9" signal. This command is legal if the process is running or stopped; otherwise the command button is desensitized (grayed-out).

Run 

Runs the program that you are currently debugging. After the initial run, Run allows you to rerun the program, maintaining the traps you have set.

Status area 

Displays information about the process that you are debugging.

Source Code area 


Displays the source code that your are currently debugging.

Annotation column 


Where such things as stop points are displayed.

"File" text field 


Displays the name of the file that you are currently debugging.

Command line area 


Area of the Main View where you can enter command-line Debugger commands.

Show/Hide annotations button 


This button (see Figure A-2) only becomes visible if you run or load a performance experiment (see the Performance Analyzer User's Guide for more information on the performance tools). This is a toggle button that shows or hides performance related annotations.

Figure A-2. Show/Hide Annotations Button in Main View

Figure A-2 Show/Hide Annotations Button in Main View

Admin Menu

Figure A-3. Admin Menu in Main View

Figure A-3 Admin Menu in Main View

The Admin menu in Main View performs general management functions dealing with processes, windows, and user preferences (see Figure A-3). The Admin menu provides these 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 box allows you to reset the environment variables LD_LIBRARY_PATH and _RLD_ROOT. You can also reset _RLD_LIST to control the set of DSOs that will be used by the program. See the reference dpage for rld for more information on these variables. Any changes you make to these variables are propagated into the Execution View shell when you run the program.

The Library Search Path dialog is opened automatically when you invoke the Debugger on an executable or core file and the Debugger is unable to find all of the required DSOs. You may also open the Library Search Path dialog box by selecting "Library Search Path..." from the Admin Menu (see Figure A-4). The list of required DSOs displays at the top of the dialog box, annotated by the status of each DSO. The status can be "OK," "Error: Cannot find library," or "Error: Core file and library mismatch." The status "Error: Core file and library mismatch" indicates that the debugger found a DSO that did not match the core file. There are three fields for the variables below the list area where you can modify their values.

Figure A-4. The Library Search Path Dialog Box

Figure A-4 The Library Search Path Dialog Box

Insert Before and Insert After move the shared object specified in the Value field before or after the selected object in the list. Modify replaces the selected object in the list with the file entered in the Value field. Remove deletes the selected shared object from the list.

"Multiprocess View..." 


Displays the Multiprocess View window, which helps you debug several processes at once.

"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. For more information, refer to the GLdebug User's Guide.

"Switch Process..." 


Changes the current process. You will be queried for the new process ID, as shown in Figure A-5. You can type it in or paste it from another window, if desired. Switching processes changes the session. If you select a process in Multiprocess View, it is used as the default value.

Figure A-5. The Switch Process Dialog Box

Figure A-5 The Switch Process Dialog Box

"Switch Executable..." 


Changes the current executable. This option also lets you debug a different core file. It brings up the dialog box shown in Figure A-6.

Figure A-6. The Switch Executable Dialog Box

Figure A-6 The Switch Executable Dialog Box

"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 to an initialization file used when the Debugger is first started. See the description of "Save Settings...", the following item.

"Save Settings..." 


Allows you to save the current preference settings to an initialization file used when the Debugger is first started. These can include such items as window sizes, current views, window configurations, and so on.

"Iconify" 

Iconifies all of the session's views.

"Raise" 

Brings all the session's view windows to the foreground and redisplays any iconified windows.

"Launch Tool" 

Lets you run the WorkShop tools. See Figure A-7. You can switch to the other tools by selecting "Build Manager," "Static Analyzer," "Performance Analyzer," or "Tester." Selecting "Debugger" lets you start another debugging session. If you buy WorkShop Pro MPF (for multi-process debugging), the "Parallel Analyzer" selection is enabled.

Figure A-7. "Launch Tool" Submenu

Figure A-7 "Launch Tool" Submenu

"Project" 

Lets you control the WorkShop tools operating on the same executable as a group. See Figure A-8. For more information on "Project View," a facility for managing CASEVision tools operating on a common target, see "Project View".

Figure A-8. "Project" Submenu

Figure A-8 "Project" Submenu

"Exit" 

Exits all views in the session and terminates the session.

Views Menu

Figure A-9. Views Menu in Main View

Figure A-9 Views Menu in Main View

The Views menu in Main View (see Figure A-9) provides these 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 a frame in the stack, you can switch the current context to the invocation of that frame and check the state of variables.

"Disassembly View" 


Displays assembly code corresponding to the source code.

"Exception View" 


Displays the Exception View, and Ada-specific window used for exception handling.

"Execution View" 


Displays the Execution View window for handling the target process's input and output.

"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 scrollable list of source files used by the current executable. Double-click a file in the list to load it directly into the source display area in Main View or Source View. The Search field lets you find files in the list quickly.

"Memory View" 


Displays the value at a given memory address.

"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. Lets you set traps, perform searches, and inspect source code without losing information in Main View.

"Structure Browser" 


Displays data structures in a graphical format. You can dereference pointers by double-clicking.

"Syscall Panel" 

Lets you set traps at the entry to or exit from system calls.

"Task View" 

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

"Trap Manager" 


Allows you to set, edit, and manage traps. (Used in both the Debugger and Performance Analyzer.)

"Variable Browser" 


Displays the 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 (see Figure A-10) lets you perform some of the queries available in the Static Analyzer. If you have previously built a cvstatic fileset, this is rather convenient; however, if you need to build the fileset from scratch, the process becomes more involved.

Figure A-10. Query Menu With Submenus

Figure A-10 Query Menu With Submenus

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

Source Menu

Figure A-11. Source Menu in Main View

Figure A-11 Source Menu in Main View

The Source menu in Main View (see Figure A-11) provides these selections to deal with source code files:

"Open..." 

Loads a source file.

"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.

"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.

"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 lets you specify a starting line, enter %d in the resource to indicate the new line number.

"Recompile" 

Displays the Build View window, which lets you 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 (see Figure A-12). 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 Main View to that point. Clicking Reset removes the search target indicators.

Figure A-12. The Search Dialog Box

Figure A-12 The Search Dialog Box

"Go to Line..." 

Lets you scroll to a position in the source code by specifying a line number. "Go to Line..." brings up a dialog box similar to the one shown in Figure A-13.

Figure A-13. Go to Dialog Box

Figure A-13 Go to 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. The cvconfig script lets you designate CASEVision/ClearCase, RCS, or SCCS. Type:

cvconfig [clearcase | rcs | sccs]

Figure A-14. Versioning Submenu

Figure A-14 Versioning Submenu

The "Versioning" submenu appears in Figure A-14.

Selecting any of these options displays a shell in which you can access the configuration management tool. The selections in the submenu are:

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

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

  • "Versioning":"UncheckOut": Cancels the checkout, with no changes registered.

Display Menu

Figure A-15. Display Menu in Main View

Figure A-15 Display Menu in Main View

The Display menu in Main View (see Figure A-15) provides these selections to annotate the source code displayed:

"Show Line Numbers"/"Hide Line Numbers" 


Displays or hides line numbers in the annotation column corresponding to the source code.

"Preferences..." 


Displays the Preferences dialog box (see Figure A-16), which lets you show or hide column annotations and menus specific to the different WorkShop tools. In the Debugger, you can display trap, pc, and context icons. If you have purchased WorkShop/MP, you can display and manipulate loop indicators. The Performance Analyzer displays experiment statistics. The Tester module (if purchased) lets you see coverage statistics. Turning off the Performance toggle deletes the performance annotations from the Source View.

Figure A-16. Preferences Dialog Box

Figure A-16 Preferences Dialog Box

"Hide Icons"/"Show Icons" 


Removes or displays the annotation column next to the source code display area.

Perf Menu

The Perf (Performance) menu (see Figure A-17) offers the following menu selections:

Select Task submenu 


Allows you to choose the task for your performance analysis. The choices available are shown in Figure A-17. You may only select one task per performance analysis run. If none of the given tasks sastisfy your requirements, you can choose the "Custom task," which will bring up the Custom Task dialog, which allows you to design your own task requirements (see Figure A-19).

Figure A-17. Perf Menu and Subwindows

Figure A-17 Perf Menu and Subwindows

Examine Results... 


Launches the Performance Analyzer (Figure A-18). For complete information on the Performance Analyzer, see the Performance Analyzer User's Guide.

Figure A-18. Launching Performance Analyzer From Perf Menu

Figure A-18 Launching Performance Analyzer From Perf Menu

Configs... 

Brings up the configurations dialog, which contains the following items:

  • "Experiment Directory" text field, which allows you to specify the directory where the data captured during the next experiment is stored. 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 will be incremented automatically for each subsequent experiment.

  • "Instrument Directory," which lets you reuse a previously instrumented executable. This technique avoids the processing necessary for a new instrumentation. Often in a series of experiments, you collect the same type of data while stressing the target executable in different ways. Reusing the instrumented executable lets you do this conveniently.

  • "Track Exec'd Processes" toggle, which enables the Executable menu, which will contain selections for any exec'd processes. These selections let you see the performance results for the other executables.

  • "Auto Launch Performance Analyzer" toggle, which automatically launches the Performance Analyzer when the experiment is completed.

    Figure A-19. Custom Task Dialog

    Figure A-19 Custom Task Dialog

The Custom Task dialog contains the following items:

"Sampling Data" toggles 


These toggles specify which type of sampling data is collected and recorded during instrumentation. The available choices are

  • "Function Counts"

  • "Basic Block Counts"

  • "PC Profile Counts"

Tracing Data" toggles" 


These toggles the type of data recorded at tthe time at which an event of the selected type occurred. The available choices are

  • "Malloc/Free Trace"

  • "Syscall Trace"

  • "Page Fault Trace"

  • "I/O Syscall Trace"

  • "FP Exception Trace"

"Pollpoint Sampling" text field 


Allows you to specify a regular time interval for capturing performance data, including resource usage and any enabled sampling or tracing functions. Pollpoint is best used with call stack data only rather than other profiling data. Its primary utility is to enable you to identify boundary points for phases.

"Fine Grained Usage" text field 


Allows you to set a time in to record resource usage data more frequently, at the specified time intervals. Fine grained usage helps you see fluctuations in usage between sample points.

"Call Stack Profiling" text field 


Allows you to set the interval for which the the call stack of the target executable is sampled.

For further information on the Performance Analyzer, see the Performance Analyzer User's Guide.

Traps Menu

Figure A-20. Traps Menu

Figure A-20 Traps Menu

The Traps menu (see Figure A-20) offers the following menu selections:

"Set Trap" 

Allows you to set a trap in your source code. You can set a trap in a number of ways, depending on which selection you make from the submenu (see Figure A-21).

Figure A-21. Set Trap Submenu

Figure A-21 Set Trap Submenu

"Set Trap":"Stop" 


Allows you to set a a stop trap at a designated line in your source code. To set a stop trap at a line displayed in Main View (or Source View), click the cursor in the source annotation column next to the appropriate line in the source code, pull down the "Set Trap" submenu, and select "Stop."

"Set Trap":"Stop At Function Entry" 


Allows you to set a stop trap at the beginning of a function. To set, highlight the function name in the source code display area and select "Set Trap," then "Stop At Function Entry."

"Set Trap":"Stop At Function Exit" 


Allows you to set a stop trap at the end of a fucntion. To set, highlight the function name in the source code display area and select "Set Trap," then "Stop At Function Exit."

"Set Trap":"Sample" 


Allows you to set a a sample trap at a designated line in your source code. To set a sample trap at a line displayed in Main View (or Source View), click the cursor in the source annotation column next to the appropriate line in the source code, pull down the "Set Trap" submenu, and select "Sample."

"Set Trap":"Sample At Function Entry" 


Allows you to set a sample trap at the beginning of a function. To set, highlight the function name in the source code display area and select "Set Trap," then "Sample At Function Entry."

"Set Trap":"Sample At Function Exit" 


Allows you to set a sample trap at the end of a function. To set, highlight the function name in the source code display area and select "Set Trap," then "Sample At Function Exit."

"Clear Trap" 

Deletes the 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 (see Figure A-22).

Figure A-22. Clear Trap Submenu

Figure A-22 Clear Trap Submenu

"Clear Trap":"Stop" 


Designates the "Stop" trap type.

"Clear Trap":"Sample" 


Designates the "Sample" trap type.

PC Menu

Figure A-23. PC Menu in Main View

Figure A-23 PC Menu in Main View

The PC (program counter) menu in Main View (see Figure A-23) provides these selections for controlling the execution of a process:

"Continue To" 

Continues the process to the selected point in the program unless some other event interrupts. You select a line by placing the cursor in it.

"Jump To" 

Goes directly to a selected point within the same function, jumping over intervening code. Waits for command to resume execution. You select a line by placing the cursor in it.

Fix+Continue Menu

Figure A-24. Fix+Continue Menu

Figure A-24 Fix+Continue Menu

The Fix+Continue menu (see Figure A-24) offers the following menu selections:

"Edit" 

Allows you to edit functions using the Debugger editor.

"External Edit" 

Allows you to edit functions using an external editor. The default editor is vi, but can be changed by using the "Set Edit Tool..." popup menu in the Admin menu of the Status window. See "Fix+Continue Status Window" for further information.

"Parse and Load" 


Parses your modified function and loads it for execution. You can execute the modified function by clicking on the Run or Continue buttons in the Debugger main view.

"Show Difference" submenu 


Allows you to see the difference between the original code and your modifications. See "Show Difference Submenu" for further information.

"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

Figure A-25. "Save File+Fixes As..." Popup Window

Figure A-25 "Save File+Fixes As..." Popup Window

you to save your changes to a file (see Figure A-25). You can save the changes to the current source file (the default), or to a separate file.

"Save All Files..."  


Launches the "Save File+Fixes As..." dialog (see Figure A-25), which allows you to update the current session, saving all the modified functions to the appropriate files.

"View" submenu 


Allows you to change to different views. Fix and Continue supports status, message, and build environment windows. See "View Submenu" for further information.

"Preferences" submenu 


Allows you to set your Fix+Continue preferences. See "Preferences Submenu" for further information.

"Cancel Edit" 

Takes you out of edit mode.

"Delete Edits" 

Deletes any changes that you made to functions.

Show Difference Submenu

This submenu

Figure A-26. Show Difference Submenu

Figure A-26 Show Difference Submenu

(see Figure A-26) allows you to see the difference between the original and your modified code. It contains the following options:

"For Function" 


Opens a window that shows you the differences between the original function 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 Preference dialog (see Figure A-29), which allows you to set the tool that displays the differences between the two sets of code. The default is xdiff. For further information on the Preference dialog, see "Preferences Submenu".

View Submenu

This submenu

Figure A-27. View Submenu

Figure A-27 View Submenu

(see Figure A-27) allows you to open different Fix+Continue view windows. It contains the following options:

"Status Window" 


Launches the Fix+Continue Status window. See "Fix+Continue Status Window" for more information.

"Message Window" 


Launches the Fix+Continue Message window. See "Fix+Continue Message Window" for more information.

"Build Environment Window" 


Launches the Fix+Continue Build Environment window. See "Fix+Continue Build Environment Window" for more information.

Preferences Submenu

The Preference

Figure A-28. Preferences Submenu

Figure A-28 Preferences Submenu

Menu (see Figure A-28) allows you to set various options for the Fix and Continue environment, such as the difference tool, the external editor command, and so on. The menu contains the following options:

"Show Preferences" 


Launches the Preference dialog (see Figure A-29), which displays the preferences that are currently enabled for the session, and allows you to change the settings.

Figure A-29. Fix+Continue Preferences Dialog

Figure A-29 Fix+Continue Preferences Dialog

The preferences available through the dialog are

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

  • "File Difference Tool" text field, which allows you to choose the tool that you use when comparing code. The default is xdiff.

  • "Copy Traps On Previous Definition" toggle. When you edit and parse a function, Fix+Continue copies traps from the old definition to the new one by mapping old lines to new lines. (This mapping is the same that 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 F&C will look at the switch.

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

  • "Continue Even If Line Has Changed" toggle. When you edit and parse a function 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, which pops up a warning dialog before a Run if you have unfinished edits.

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

  • "Save deactivated code during File Save" toggle. 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 won't get compiled. You can manually edit the source to use the old definition in any way you desire.

"Reset Factory Defaults" 


Sets the preferences to the installed defaults.

"Save Preferences" 


Allows you to save your preferences to a file. This item brings up the File dialog. See Figure A-139.

"Load Preferences..." 


Allows you to load preferences from a file. This item brings up the File dialog. See Figure A-139.

Keyboard Accelerators

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

Table A-1. Fix and Continue Keyboard Accelerators

Command

Ctrl + key

Cancel Edit

U

Edit

E

External Edit

X

Parse And Load

P


Help Menu

Figure A-30. Help Menu

Figure A-30 Help Menu

The Help menu (see Figure A-30) provides these options:

"Click for Help" 


Provides information on the selected window's feature.

"Overview" 

Provides overview 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 general copyright and version number information on the current tool.

Basic Windows

This section discusses some of the basic additional views that are available throught the Debugger; the Execution View, Source View, and Process Meter.

Execution View

The Execution View window is a simple shell that lets you set environment variables and inspect error messages. Your target program I/O, if any, will be displayed in the Execution View window. If the program is I/O-based, then all interaction takes place in Execution View.

The Execution View (see Figure A-31) is launched automatically with the Debugger.

Figure A-31. Execution View

Figure A-31 Execution View

Source View

The Source View (see Figure A-32) displays your source, opening your Main program file by default.

Figure A-32. Source View

Figure A-32 Source View

Menu Bar

The Source View menu bar contains five items that are duplicated from the Main View: Display, Traps, PC, and Fix+Continue. Each of these menus has the same functionality as its counterpart in the Main View (see "Main View"). The only new menu bar item is the file menu (Figure A-33), described below:

Figure A-33. Source View File Menu

Figure A-33 Source View File Menu

"Open..." 

Launches the file dialog (see Figure A-139), allowing you to choose a file to load into the source view.

"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.

"Save As Text..." 


records the information in the display area as a text file.

"Open Separate..." 


launches the File dialog, allowing you to create a new source view with the contents of a different source file.

"Insert File..." 

inserts the text of a file within your current file.

"Clone" 

clones the current window.

"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 lets you specify a starting line, enter %d in the resource to indicate the new line number.

"Recompile" 

displays the Build View window, which lets you compile the source code associated with the current executable.

"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 (see Figure A-12). 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 Main View to that point. Clicking Reset removes the search target indicators.

"Go To Line..." 

launches the Go To Line dialog, which allows you to go to a specific line in the source. You can type in the line, or select the line number via the slider bar.

Figure A-34. Go To Line Dialog

Figure A-34 Go To Line Dialog

"Versioning" 

provides access to the configuration management tool, if you have designated one. The cvconfig script lets you designate CASEVision/ClearCase from SGI, RCS or SCCS. Type:

cvconfig [clearcase | rcs | sccs]

Selecting any of these options displays a shell in which you can access the configuration management tool. The selections in the submenu are:

"Versioning":"CheckIn"  


saves the source file and checks it into the database as a new version.

"Versioning":"CheckOut"  


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

"Versioning":"UncheckOut" 


cancels the checkout, with no changes registered.

"Close" 

Dismisses the Source View window.

Process Meter

The Process Meter monitors the resource usage of a running process without saving the data. Figure A-35 shows the Process Meter in its default configuration (with only the User/Sys Time chart active).

Figure A-35. Process Meter

Figure A-35 Process Meter

The Process Meter contains its own menu bar, which contains the Admin, Charts, Scale, and Help menus. The Admin menu is the same as that described in "Admin Menu". The Help menu is the same as that described in "Help Menu". The other menus are described in the following sections.

Charts Menu

Figure A-36. Process Meter Charts Menu

Figure A-36 Process Meter Charts Menu

The Charts Menu contains a set of toggles that allow you to choose which charts are displayed in the Process Meter. You can display as many charts simultaneously as you wish. The choices available are:

  • User/Sys Time (the default)

  • Major/Minor Faults

  • Context Switches

  • Bytes Read/Written

  • Read/Write Sys Calls

  • Other Sys Calls

  • Total Sys Calls

  • Signals

  • Process Size

Scale Menu

Figure A-37. Process Meter Scale Menu

Figure A-37 Process Meter Scale Menu

The Scale Menu is a radio button panel that allows you to set the time scale for the processes displayed in the Process Meter. The choices available are:

  • 2 seconds

  • 5 seconds

  • 10 seconds

  • 30 seconds

  • 1 minute (the default)

  • 2 minutes

  • 5 minutes

  • 10 minutes

Ada-specific Windows

This section discusses the Debugger windows that are specific to Ada: the Task View and Exception View.

Task View

The Task View is an Ada-specific view that provides you with task and callstack information. If you do not have Ada installed on your system, the Task View menu item in the Views menu will be grayed-out.

Figure A-38. Task View

Figure A-38 Task View

The Task View contains its own menu bar, which contains the Admin, Config, Display, and Help menus. The Help menu is the same as that described in "Help Menu". The other menus are described in the following sections.

In addition, the Task View contains the following items:

Process Sort toggles 


Allow you to sort the process list in one of three ways, depending on which of the following radio buttons are active:

  • "Name"

  • "Status"

  • "Sproc"

Process Display tabs 


Allows you to view either a list of the tasks, or the details of the currently running (and highlighted) task. (See Figure A-39.)

Figure A-39. Task View Process Detail View

Figure A-39 Task View Process Detail View

Task Display tabs 


Allows you to view the callstack information, or the callstack details of the currently selected process.(See Figure A-40.)

Figure A-40. Task View Callstack Detail View

Figure A-40 Task View Callstack Detail View

Admin Menu

The Admin Menu (see Figure A-41) contains the following items:

Figure A-41. Task View Admin Menu

Figure A-41 Task View Admin Menu

"Active" toggle
Activates the current window in a set of cloned windows. In the current release, this toggle is always active.

"Clone" 

Creates a clone of the current window. This function is not supported in the current release, and the option is grayed out.

"Save As Text..." 


Launches the "Save Text" dialog (see Figure A-49). This dialog allows you to save your current session as text in a file you designate.

"Close"  

Closes the current window.

Config Menu

The Config Menu (Figure A-42) contains the following items:

"Preferences..." 


launchest the preference dialog (Figure A-42), which allows you the option of setting the maximum depth of the Task View.

Figure A-42. Task View Config Menu

Figure A-42 Task View Config Menu

Layout Menu

Figure A-43. Task View Layout Menu

Figure A-43 Task View Layout Menu

The Layout Menu (Figure A-41) contains the following toggles:

"Task List" 

Causes only the Callstack Display to be shown.

"Single Task" 

Causes only the Process Display to be shown.

Display Menu

Figure A-44. Task View Display Menu

Figure A-44 Task View Display Menu

The Display Menu (Figure A-41) is divided into the Task List Format and Callstack Format sections. The Callstack Format toggles match the toggles that are contained in the Callstack View Display menu. The Task List Format toggles control what radio buttons are made available in the toggle sort list, as well as what information is displayed in the Process Display area.

The Task View Display menu contains the following toggles:

"Status" 

Displays the status of the process. This toggle is active by default.

"Priority" 

Displays the priority of the process.

"Sproc" 

Displays the sproc value of the process. This toggle is active by default.

"Resource Vector" 


Displays the resource vector value of the process.

"Arg Values" 

Allows you to set the argument values in the Task View. This toggle is active by default.

"Arg Names" 

Allows you to set the argument names in the Task View. This toggle is active by default.

"Arg Types" 

Allows you to set the argument types in the Task View.

"Location" 

Allows you to set the function location in the Task View. This toggle is active by default.

"PC" 

Allows you to set the PC in the Task View.

Exception View

The Exception View is an Ada-specific view that allows you to set traps on exceptions. This view only functions if Ada is installed.

Figure A-45. Exception View

Figure A-45 Exception View

The Exception View contains the following items:

Admin menu 

Contains the following items:

  • "Active" toggle: Activates the current window in a set of cloned windows. In the current release, this toggle is always active.

  • "Clone": Creates a clone of the current window. This function is not supported in the current release, and the option is grayed out.

  • "Save As Text...": Launches the "Save Text" dialog (see Figure A-49). This dialog allows you to save your current session as text in a file you designate.

  • "Close": Closes the current window.

"Stop" toggle 

Indicates when a trap is active.

"When" option menu 


Allows you to select when an exception trap fires. Contains the following choices:

  • "Always:" stop any time the exception is raised.

  • "Catch-All:" stop when caught by a catchall rather than an explicit handler, or when unhandled.

  • "Unhandled:" stop when the exception is unhandled.

The process is always stopped at the point of a raise.

"Search" text field 


Allows you to search for an exception.

Figure A-46. "When" Exception Option Menu

Figure A-46 "When" Exception Option Menu

X/Motif Analyzer Windows

The X/Motif analyzer provides 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.

To access the X/Motif analyzer window, you must pull down the Views menu and select "X/Motif Analyzer" (see Figure A-47).

Figure A-47. Launching the X/Motif Analyzer

Figure A-47 Launching the X/Motif Analyzer

Global Objects

Though the X/Motif Analyzer is made up of several different examiner windows, a number of objects remain constant throughout window changes. The examiner windows available are

Admin Menu

The Admin menu (see Figure A-48) offers the following menu selections:

Figure A-48. Admin Menu

Figure A-48 Admin Menu

"Active" toggle 


Activates the current window in a set of cloned windows. In the current release, this toggle is always active.

"Clone" 

Creates a clone of the current window. This function is not supported in the current release, and the option is grayed out.

"Save As Text..." 


Launches the "Save Text" dialog (see Figure A-49). This dialog allows you to save your current session as text in a file you designate.

"Close"  

Closes the current window.

Figure A-49. "Save Text" Dialog

Figure A-49 "Save Text" Dialog

Examine Menu

The Examine menu (see Figure A-50) offers the following menu selections:

Figure A-50. Examine Menu

Figure A-50 Examine Menu

"Selection" 

Selects the currently highlighted object for examination.

"Widget" 

Uses the current selection as input to the widget examiner, then opens that examiner (see "Widget Examiner" for information).

"Widget Tree" 

Switches the window view to the widget tree examiner (see "Tree Examiner" for information).

"Widget Class" 

Switches the window view to the widget class examiner (see "Widget Class Examiner" for information).

"Window" 

Switches the window view to the window examiner (see "Window Examiner" for information).

"X Event" 

Switches the window view to the X Event examiner (see "Event Examiner" for information).

"X Graphics Context" 


Switches the window view to the X graphics context examiner (see "Graphics Context Examiner" for information).

"X Pixmap" 

Switches the window view to the X pixmap examiner (see "Pixmap Examiner" for information).

Examiner Tabs

In addition to access through the Examine menu, each examiner can be accessed through a tab at the bottom of each view (see Figure A-51).

Figure A-51. Examiner Tabs

Figure A-51 Examiner Tabs

When first launched, the X/Motif Analyzer has only four tabs: Breakpoints, Trace, Widget, and Tree. As you use new examiners through the Examine menu, new tabs are added for the new examiners. Any of these new tabs may be deleted at any time by selecting the tab, clicking the right mouse button, and then selecting "Remove Examiner" (see Figure A-52). The initial four tabs may not be removed.

Figure A-52. Removing Tabs

Figure A-52 Removing Tabs

Return Button

The "Widget" and "Name" text fields both have return buttons (see Figure A-53) just to their right. Clicking these buttons causes the X/Motif Analyzer to respond exactly as if you had pressed Return on your keyboard.

Breakpoints Examiner

The Breakpoints examiner is not really an examiner, but a control area where you can set widget-level breakpoints. The breakpoints examiner is divided into three areas (see Figure A-53):

  • The widget specification area, which contains the same information as that in the Widget examiner. You can select a widget address, name, or class in this area, as well as move to the widgets parents or children, or select a widget in the application. In cases where the breakpoint type does not apply to widgets (for example, input-handler breakpoints), this area is blank.

  • The parameter specification area, the contents of which vary according to the type of breakpoint you are setting. For example, for Callback breakpoints, this area contains the callback name and client data; for event-handler breakpoints, it contains the event type and the client data, and so on.

  • The breakpoint area, which contains the breakpoint name, a search field, and the Add, Modify, Delete, and Step To buttons.

    Figure A-53. Breakpoints Examiner

    Figure A-53 Breakpoints Examiner

The control area has eight different breakpoint types that it can examine. These types are set through the "Breakpoint Type" option button (see Figure A-54). The options for the "Breakpoint Type" option button are described below:

Figure A-54. Breakpoint Type Option Button

Figure A-54 Breakpoint Type Option Button

  • "Callback:" Widget callback installed by XtAddCallback. Parameters include callback name and client_dataXtPointer value. See "Callback Breakpoints Examiner" for more information.

  • "Event-Handler:" Widget event handler installed by XtAddEventHandler. Parameters include X event type and client_dataXtPointer value. See "Event-Handler Breakpoints Examiner" for more information.

  • "Resource-Change:" Resource change caused by XtSetValues or XtVaSetValues. Parameters include resource name and resource value, both strings. See "Resource-Change Breakpoints Examiner" for more information.

  • "Timeout-Procedure:" Timeout callback installed by XtAppAddTimeOut. Parameters include client_dataXtPointer value. See "Timeout-Procedure Breakpoints Examiner" for more information.

  • "Input-Handler:" Input callback installed by XtAppAddInput. Parameters include client_dataXtPointer value. See "Input-Handler Breakpoints Examiner" for more information.

  • "State-Change:" Various widget state changes (for example, "managed" or "realized"). Parameters include widget state. See "State-Change Breakpoints Examiner" for more information.

  • "X-Event:" X event received by target application. Parameters include X event type. See "X-Event Breakpoints Examiner" for more information.

  • "X-Request:" X request received by target application. Parameters include X request type. See "X-Request Breakpoints Examiner" for more information.

Callback Breakpoints Examiner

When the "Callback" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-55.

Figure A-55. Callback Breakpoints Examiner

Figure A-55 Callback Breakpoints Examiner

The Callback Breakpoints examiner contains the following items:

"Widget" text field 


Allows you to choose a widget to examine by entering the widget address.

"Name" text field 


Allows you to choose a widget to examine by entering the widget name.

"Class" text field 


Allows you to choose a widget to examine by entering the widget's class. Leave the field blank or enter Any to select all widgets.

Parent button 

Allows you to move the parent of the currently selected widget.

Previous button 

Moves you to the previously selected widget.

Children... button 


Shows you the widget's children (it is grayed out if the selected widget cannot have children).

Select... button 

Allows you to select the widget in the target process.

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"Callback Name" text field 


Allows you to set the name of the callback for the breakpoint.

"Client_Data" text field 


Allows you to pass in and get back pointer values for the Client_Data.

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

Event-Handler Breakpoints Examiner

When the "Event-Handler" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-56.

Figure A-56. Event-Handler Breakpoints Examiner

Figure A-56 Event-Handler Breakpoints Examiner

The Event-Handler Breakpoints examiner contains the following items:

"Widget" text field 


Allows you to choose a widget to examine by entering the widget address.

"Name" text field 


Allows you to choose a widget to examine by entering the widget name.

"Class" text field 


Allows you to choose a widget to examine by entering the widget's class. Leave the field blank or enter Any to select all widgets.

Parent button 

Allows you to move the parent of the currently selected widget.

Previous button 

Moves you to the previously selected widget.

Children... button 


Shows you the widget's children (it is grayed out if the selected widget cannot have children).

Select... button 

Allows you to select the widget in the target process.

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"Event Type" option button 


Takes the place of the "Callback Name" text field in the Callback Breakpoints examiner. Allows you to set the event type for a given breakpoint. The types available are shown in Figure A-57.

Figure A-57. Event Type Option Button

Figure A-57 Event Type Option Button

"Client_Data" text field 


Allows you to pass in and get back pointer values for the Client_Data.

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

Resource-Change Breakpoints Examiner

When the "Resource-Change" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-58.

Figure A-58. Resource-Change Breakpoints Examiner

Figure A-58 Resource-Change Breakpoints Examiner

The Resource-Change Breakpoints examiner contains the following items:

"Widget" text field 


Allows you to choose a widget to examine by entering the widget address.

"Name" text field 


Allows you to choose a widget to examine by entering the widget name.

"Class" text field 


Allows you to choose a widget to examine by entering the widget's class. Leave the field blank or enter Any to select all widgets.

Parent button 

Allows you to move the parent of the currently selected widget.

Previous button 

Moves you to the previously selected widget.

Children... button 


Shows you the widget's children (it is grayed out if the selected widget cannot have children).

Select... button 

Allows you to select the widget in the target process.

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"Resource Name" text field 


Takes the place of the "Callback Name" text field. Allows you to set the resource name for the breakpoint.

"Resource Value" text field 


Takes the place of the "Client Data" text field. Allows you to set the resource value for the breakpoint.

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

Timeout-Procedure Breakpoints Examiner

When the "Timeout Procedure" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-59.

Figure A-59. Timeout-Procedure Breakpoints Examiner

Figure A-59 Timeout-Procedure Breakpoints Examiner

The Resource-Change Breakpoints examiner contains the following items:

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"Client_Data" text field 


Allows you to pass in and get back pointer values for the Client_Data.

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

Input-Handler Breakpoints Examiner

When the "Input-Handler" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-60.

Figure A-60. Input-Handler Breakpoints Examiner

Figure A-60 Input-Handler Breakpoints Examiner

The Input-Handler Breakpoints examiner contains the following items:

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"Client_Data" text field 


Allows you to pass in and get back pointer values for the Client_Data.

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

State-Change Breakpoints Examiner

When the "State-Change" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-61.

Figure A-61. State-Change Breakpoints Examiner

Figure A-61 State-Change Breakpoints Examiner

The Resource-Change Breakpoints examiner contains the following items:

"Widget" text field 


Allows you to choose a widget to examine by entering the widget address.

"Name" text field 


Allows you to choose a widget to examine by entering the widget name.

"Class" text field 


Allows you to choose a widget to examine by entering the widget's class. Leave the field blank or enter Any to select all widgets.

Parent button 

Allows you to move the parent of the currently selected widget.

Previous button 

Moves you to the previously selected widget.

Children... button 


Shows you the widget's children (it is grayed out if the selected widget cannot have children).

Select... button 

Allows you to select the widget in the target process.

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"State Type" option button 


Takes the place of the "Callback Name" text field in the Callback Breakpoints examiner. Allows you to set the state change type for a given breakpoint. The types available are as follows (see Figure A-62):

  • Created

  • Destroyed

  • Managed

  • Realized

  • Unmanaged

  • Any

    Figure A-62. State Type Option Button

    Figure A-62 State Type Option Button

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

X-Event Breakpoints Examiner

When you select the "X-Event" option of the "Breakpoint Type" option button in the Breakpoint Examiner, the examiner appears as shown in Figure A-63.

Figure A-63. X-Event Breakpoints Examiner

Figure A-63 X-Event Breakpoints Examiner

The X-Event Breakpoints examiner contains the following items:

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

"Event Type" option button 


Takes the place of the "Callback Name" text field in the Callback Breakpoints examiner. Allows you to set the event type for a given breakpoint. The types available are shown in Figure A-64.

Figure A-64. Event Type Option Button

Figure A-64 Event Type Option Button

"Window ID" text field 


Takes the place of the "Client_Data" text field. Allows you to set the Window ID value for the breakpoint.

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

X-Request Breakpoints Examiner

When the "X-Request" option of the "Breakpoint Type" option button in the Breakpoint Examiner is selected, the examiner appears as shown in Figure A-65.

Figure A-65. X-Request Breakpoints Examiner

Figure A-65 X-Request Breakpoints Examiner

The X-Request Breakpoints examiner contains the following items:

"Breakpoint Type" option button 


Allows you to select the type of breakpoint you wish to set.

Clear button 

Clears all the current breakpoint selections and text fields.

Request Type button 


Launches the "Request Type Selection" dialog (see Figure A-66). This dialog allows you to select the type of X-Request used for your breakpoint. The information displayed is in outline form; selecting a given item selects all its subitems. For example, if you select Window-Category, CreateWindow, ChangeWindowAttributes, GetWindowAttributes, and so on are also selected.

Figure A-66. "Request Type Selection" Dialog

Figure A-66 "Request Type Selection" Dialog

"Search" text field 


Allows you to perform a text search through your breakpoints.

Add button 

Allows you to add a new breakpoint.

Modify button 

Allows you to change the selected breakpoint's settings.

Delete button 

Deletes the selected breakpoint.

Step To button 

Allows you to step to the next condition. Step To creates a temporary breakpoint, resumes the process, and waits until the process stops. This temporary breakpoint acts exactly like an ordinary breakpoint, save that the Step To button automatically resumes the process and puts up a busy cursor until the condition becomes true.

Trace Examiner

The Trace examiner (see Figure A-67) is a control area where you can trace the execution of your application and collect various forms of data. The following data is collected:

  • X Server Events

  • X Server Requests

  • Widget Event Dispatch Information

  • Widget Resource Changes (through XtSetValues)

  • Widget State Changes (create, destroy, manage, realize, unmanage)

  • Xt Callbacks (widget, event handler, work proc, timeout, input, signal)

    Figure A-67. Trace Examiner

    Figure A-67 Trace Examiner

The Trace examiner contains the following items:

"Collect Trace" toggle 


Allows you to turn the tracing on and off.

"File" text field 

Allows you to select the filename for the trace. If no file is selected, a default filename for the trace is chosen.

"Search" text field 


Allows you to perform an incremental, textural search for the trace list.

Filter... button 

Launches a dialog that allows you to select the trace entry types you want displayed in the list.

Clear File button 


Erases the trace file. Any subsequent trace information goes to the beginning of the file.

Widget Examiner

The Widget examiner (see Figure A-68) displays the internal Xt widget structure, as well as the Xt inheritance implemenation using nested C structs.

Figure A-68. Widget Examiner

Figure A-68 Widget Examiner

The Widget examiner contains the following items:

"Widget" text field 


Allows you to choose a widget to examine by entering the widget address.

"Name" text field 


Allows you to choose a widget to examine by entering the widget name.

Parent button 

Allows you to move the parent of the currently selected widget.

Previous button 

Moves you to the previously selected widget.

Children... button 


Shows you the widget's children. (It is grayed out if the selected widget cannot have children.)

Select... button 

Allows you to select the widget in the target process.

Tree Examiner

The Tree examiner (see Figure A-69) displays the widget hierarchy.

Figure A-69. Tree Examiner

Figure A-69 Tree Examiner

You may double-click a node to view that widget in the Widget examiner. Use the option menu in the bottom-right corner to switch the display among widget names, class names, and IDs.

If the Tree examiner is currently selected, it will not automatically fetch the current widget tree each time the process stops. To force retrieval of the widget tree, select another examiner and then go back to the Tree examiner. Or, click on the Tree tab.

You may display the tree according to widget name, class, or ID value. You can select this by choosing the appropriate option from the widget view type option button (see Figure A-70) in the lower-right portion of the examiner.

Figure A-70. Widget View Type Option Button

Figure A-70 Widget View Type Option Button

Callback Examiner

The Callback examiner (see Figure A-71) automatically appears when the process is stopped somewhere in a callback. It first displays the callstack frame for the callback function. Next, it displays information about the widget in the callback. Finally, it displays the proper callback structure contained in the call_data argument to the callback procedure, based on the widget type and the callback name.

Figure A-71. Callback Examiner

Figure A-71 Callback Examiner

Window Examiner

The Window examiner (see Figure A-72) displays window attributes for an X window. These are the attributes returned by XGetWindowAttributes, with decoding of the Visual structure and enums and masks decoded. Additionally, the Window examiner shows the parent and children window IDs.

Figure A-72. Window Examiner

Figure A-72 Window Examiner

The Window examiner contains the "Window" text field, which displays the address of the window that is being examined. You may change to a different window by entering a new address and pressing the ENTER key.

Event Examiner

The Event examiner (see Figure A-73) displays the event structure for an XEvent pointer. The proper XEvent union member is used, and enums and masks are decoded.

Figure A-73. Event Examiner

Figure A-73 Event Examiner

The Event examiner contains the "X Event" text field, which displays the address of the X event that is being examined. You may change to a different X event by entering a new address and pressing the ENTER key.

Graphics Context Examiner

The Graphics Context examiner (see Figure A-74) displays the X graphics context attributes that are cached by Xlib in the form of an XGCValues structure. Enums and masks are decoded.

Figure A-74. Graphics Context Examiner

Figure A-74 Graphics Context Examiner

The Graphics Context examiner contains the "GC" text field, which displays the address of the graphics context that is being examined. You may change to a different context by entering a new address and pressing the ENTER key.

Pixmap Examiner

The Pixmap examiner (see Figure A-75) displays basic attributes of an X pixmap, like size and depth. It also attempts to provide an ASCII display of small pixmaps, using the units digit of the pixel values.

Figure A-75. Pixmap Examiner

Figure A-75 Pixmap Examiner

The Pixmap examiner displays the contents of an X pixmap. Specify the X pixmap identifier and optionally, the X colormap identifier, by entering expressions in the two text areas at the top of the window. Use 'default' as the colormap identifier to specify the default X colormap for your screen. In the actual pixmap display, left-click on a pixel to see the pixel value, position, and red-green-blue intensities.

Widget Class Examiner

The Widget Class examiner (see Figure A-76) displays the Xt widget class structure, as well as the Xt inheritance implementation using nested C structs.

Figure A-76. Widget Class Examiner

Figure A-76 Widget Class Examiner

The Widget Class examiner contains the "W Class" text field, which displays the address of the widget class that is being examined. You may change to a different widget class by entering a new address and pressing the ENTER key.

Project Session Management Windows

A project is a single CASEVision work session focused on a common task. Its purpose is to let you perform operations conveniently on selected project components or on the project as a whole. A project includes all CASEVision tools and windows invoked from the command line (unless invoked with the -privateProject switch) and from the graphical user interface of one of those tools.

When you are working on a single project, with only a few windows open simultaneously, you can keep track of your activities with relative ease. In situations where you have many windows open from one or more projects, it is easy to get confused. To simplify the use of multiple windows, WorkShop provides facilities for iconifying and raising windows in

  • Main View Admin menu

  • the "Project" submenu

  • the Project View window

Figure A-77 shows where these facilities are located.

Figure A-77. Iconify and Raise Facilities

Figure A-77 Iconify and Raise Facilities

The window facilities in the Main View Admin menu apply to the current application and its windows only. "Iconify" iconifies all of the application's views. "Raise" brings all the application's view windows to the foreground and redisplays any iconified windows.

The "Project" submenu selections "Iconify," "Raise," "Remap Paths...," and "Exit" operate the same way as their counterparts do in the MainView Admin menu, except that they are applied to all tools and windows in the current project.

Project View

To display the Project View window, in the Main View, pull down the Admin menu, select the "Project" submenu, and select "Project View..." The Project View window is shown in Figure A-78 with its Admin menu and right-button popup menu. Project View represents the components of a project (tools or windows depending on the toggles in the Admin menu) as buttons. Elements from the same project are grouped within a rectangle. A dashed-line rectangle indicates the currently selected project. When a project is selected, you can change its name or change the command.

Figure A-78. Project View Window with Menus

Figure A-78 Project View Window with Menus

Project View Admin Menu

The "Show Applications" and "Show Windows" toggle selections in the Admin menu determine whether applications or individual windows display as project element buttons. The "Rescan" selection reevaluates the state of your projects and redisplays the current elements. "Exit" closes the Project View window.

Project View Text Fields

The Project field lets you enter a name to identify the current project.

The Command field lets you invoke other tools to be included in the project. These can be WorkShop tools or integrated tools, such as CASEVision/ClearCase.

Project Display Area

The elements of a project are represented by buttons. When a button protrudes from the screen, the item is currently iconified; when it is recessed, the item is displayed. Clicking the button toggles it between display and iconify modes.

Project Popup Menu

When you hold down the right mouse button inside a project rectangle, the Project popup menu displays. It lets you "Iconify," "Raise," or "Quit" the item under the cursor or all items in the project as a whole, if the cursor is within the rectangle but not over an item.

Trap Management Windows

In addition to setting traps through the Main View and the command line, the debugger provides you with three views specific to trap management:

  • Trap Manager

  • Signal Panel

  • Syscall Panel

Trap Manager

The Trap Manager allows you to set, edit, and manage traps (used in both the Debugger and Performance Analyzer). The Trap Manager is shown in Figure A-79.

Figure A-79. Trap Manager

Figure A-79 Trap Manager

The Trap Manager contains the following items (besides the menu bar, which is discussed below):

"Trap" text field 


Contains a description of the trap.

"Condition" text field 


Contains the condition of the trap.

"Cycle Count" text field 


Displays the current cycle count.

"Current Count" text field 


Displays the current trap count.

Modify button 

Allows you to change the selected breakpoint's settings.

Add button 

Allows you to add a new breakpoint.

Clear button 

Clears all the current breakpoint selections and text fields.

Delete button 

Deletes the selected breakpoint.

Trap Display area 


Contains a description of each trap, and a toggle to indicate whether or not the trap is active.

"Search" text field 


Allows you to perform an incremental, textural search for the trap list.

The Trap Manager has a menu bar which contains the Admin, Config, Traps, Display, and Help menus. The Admin menu is the same as that described in "Admin Menu". The Help menu is the same as that described in "Help Menu". The other menus are described in the following sections.

Config Menu

Figure A-80. Trap Manager Config Menu

Figure A-80 Trap Manager Config Menu

The Config Menu (Figure A-80) contains the following items:

"Load Traps..." 


Brings up the File dialog (see Figure A-139), allowing you to load the traps from a file.

"Save Traps..." 


Brings up the File dialog (see Figure A-139), allowing you to save the current traps to a file.

Traps Menu

Figure A-81. Trap Manager Traps Menu

Figure A-81 Trap Manager Traps Menu

The Traps Menu (Figure A-81) allows you to set traps under a number of conditions. These conditions are:

  • "At Source Line"

  • "Entry Function"

  • "Exit Function"

  • "Stop Trap Default"

  • "Sample Trap Default"

  • "Group Trap Default"

  • "Stop All Default"

Display Menu

Figure A-82. Trap Manager Display Menu

Figure A-82 Trap Manager Display Menu

The Display Menu (Figure A-82) contains the following items:

"Delete All" 

Deletes all traps from the trap list.

Signal Panel

The Signal Panel displays the signals that can occur. You can specify which signals trigger traps and which are to be ignored. The Signal Panel is shown in Figure A-83.

Figure A-83. Signal Panel

Figure A-83 Signal Panel

The Signal Panel contains an Admin menu (described in "Admin Menu") and a Help menu (described in "Help Menu"). Each signal trigger trap in the display has a toggle associated with it. In addition, the panel has a Search field.

Syscall Panel

The Syscall Panel lets you set traps at the entry to or exit from system calls. The Syscall Panel is shown in Figure A-84.

Figure A-84. Syscall Panel

Figure A-84 Syscall Panel

The Syscall Panel contains an Admin menu (described in "Admin Menu") and a Help menu (described in "Help Menu"). Each system call in the display has two toggle associated with it: one to set a trap on entry, one to set a trap on exit. In addition, the panel has a Search field.

Data Examination Windows

There are several windows that are used primarily to examine your debugging data:

Array Browser

To examine data in an array variable, select Array Browser from the Views menu at a point in the process where the variable is present. Array Browser lets you view elements in a multi-dimensional array (up to 100 x 100 elements), presented in a spreadsheet and graphically, if desired. (For a tutorial example of the Array Browser, see "Examining Data".)

Figure A-85. Array Browser With Display Menu Options

Figure A-85  Array Browser With Display Menu Options

The array specification area lets you specify the variable and its dimensions. It consists of these fields:

Array:  

Lets you enter the name of the array variable. This entry is language-dependent.

For Fortran, the expression may be an array or a dummy array variable name. If the last dimension of the array is unspecified (*), a subscript value of 1 is assumed initially.

For C and C++, the entry may be an array, a pointer, or an array pointer. If pointers are used, the expression is treated as though it were a single element, in which case you need to use the subscript controls to see more than the first element.

Indexing Expression:  


The expression used to view an element in the array. It is filled in automatically when you specify an array to view.

The expression supplied is language-specific. It represents the indexing expression used in the language to access a particular element. The subscripts are specified by special indexing variables ($i, $j, $k, and so forth) that can be manipulated in the subscript controls area.

The subscript control area serves two functions: (1) it lets you control which elements in the variable are to be displayed, and (2) it lets you shift the current element. The number of dimensions in the array governs the number of controls that are displayed. A close-up view of the subscript controls area appears in Figure A-86.

Figure A-86. Subscript Control Area in Array Browser

Figure A-86 Subscript Control Area in Array Browser

The subscript control area provides these features

row/column toggles  


Control whether an index variable represents rows or columns (or neither) in the spreadsheet area. You are not limited by the number of vectors in an array, but you can only view a two-dimensional orthogonal slice of the array at a time.

index identifiers 

Indicate to which subscript the controls in the row refer.

index values  

Show the value of the subscript for the element currently in the focus cell. You can enter a different value if you wish.

index sliders  

Let you move the focus cell along the particular vector.

index minimums 


Identify the beginning visible element in a vector.

index maximums 


Identify the last visible element in a vector. If you have an unspecified array, you can use this field to specify the last element in the vector to be displayed in the spreadsheet.

step indicators 

Specifies the increment between adjacent elements in a vector to be displayed. A value of 1 displays consecutive data. Specifying some n greater than 1 lets you display every nth element in a vector.

control area scroll bars  


Let you expose hidden portions of the subscript control area if your window is not large enough for viewing all of the controls.

The spreadsheet area is where numeric data is displayed. It can show two dimensions at a time (indicated in the upper left corner of the matrix). The column indexes run along the top of the matrix and the row indexes are displayed along the left column. The spreadsheet area has scroll bars for viewing data elements not currently visible in the viewing area. Figure A-87 shows a close-up of the spreadsheet area.

Figure A-87. Array Browser Spreadsheet Area

Figure A-87  Array Browser Spreadsheet Area

The current element is highlighted by a colored rectangle in the spreadsheet area. Its corresponding expression is shown in the current element identifier field, and the value is shown in the current element value field.

Spreadsheet Menu

Figure A-88. Spreadsheet Menu

Figure A-88 Spreadsheet Menu

The Spreadsheet menu (see Figure A-88) lets you change the appearance of data in the spreadsheet area. It provides these selections:

"Column Width..." 


Lets you specify the width of the spreadsheet cells in terms of characters. For instance, a value of 12 indicates that 12 characters, including punctuation and digits are viewable.

"Wrapped Display" 


Lets you display a single dimension of an array wrapped around the entire spreadsheet area. The index value for an element is determined by adding the appropriate row index and column index values.

Figure A-89 shows an example of a wrapped array. There is only one index $i. The current cell is element 4 in the array (by adding 3 and +1).

Figure A-89. Example of Wrapped Array

Figure A-89  Example of Wrapped Array

Format Menu

Figure A-90. Format Menu With Value Submenu

Figure A-90 Format Menu With Value Submenu

The Format menu (see Figure A-90) displays a separate menu that you lets you display the elements in the default format, as formatted values (decimal, unsigned, octal, and so forth) or as their data types.

The graphical display area presents the array data in a 3-D graph in one of the following forms:

  • surface (polyhedron)

  • bar chart

  • points

  • multiple lines (array vectors)

Render Menu

Figure A-91. Render Menu

Figure A-91 Render Menu

You select the graphical display mode through the Render menu. The Render menu (see Figure A-91) has the following items:

"Surface" 

Exhibits the data as a solid using the data values as vertices in a polyhedron.

"Bar Chart" 

Presents the data values as 3-D bar charts.

"Points" 

Simply plots the data values in 3-D space.

"Multi Line" 

Plots and connects the data values in each row.

"None" 

Lets you display Array Browser with no graphical display, in effect turning off graphical display mode.

Color Menu

Figure A-92. Color Menu

Figure A-92 Color Menu

The Color menu (see Figure A-92) provides these options:

"Monotone Ramp" 


Displays the data values in a single tone, with lower numbers being darker and higher values lighter in tone.

"Hue Ramp" 

Displays the data values in a spectrum of colors ranging from blue (lowest values) through green, yellow, orange, and red (highest values).

"Exception" 

Lets you flag certain conditions by color, usually for the purpose of spotting bad data. When you select "Exception," the controls shown in Figure A-93 appear in the window.

Figure A-93. Color Exception Portion of Array Browser Window

Figure A-93  Color Exception Portion of Array Browser Window

Thus, you can highlight data values less than or greater than specified values, values of plus or minus infinity, values of plus or minus underflow, zero values, and NaN (not a number) values.

Figure A-94. Array Browser Graphic Modes

Figure A-94  Array Browser Graphic Modes

Scale Menu

Figure A-95. Scale Menu

Figure A-95 Scale Menu

The Scale menu (see Figure A-95) provides options for changing the ratio of the z-dimension, which represents the value of the element. The number on the left represents the value of the x- and y-dimensions (which are always the same as each other); the number on the right is the z dimension.

Manipulating the z-dimension affects the ease of spotting differences in values. If your data is scattered over a narrow range of values, you may wish to heighten the graph by selecting "10:1" as your scale; this exaggerates the values in the z-dimension. If your data is in a wide range, selecting "1:2" or "1:10" as the scale will minimize the differences, flattening the graph.

Examiner Viewer Controls

The graphical display uses controls and menus from Examiner Viewer. Examiner Viewer is based on a camera metaphor and borrows terms from the film industry, such as zoom and dolly, in naming its controls. The graphical display area of the window is shown in Figure A-96, with its main controls and menus. Note that the buttons on the upper right side of the graphical display area may not be visible if the area is too small; you can expose them by moving either the upper or lower sash to enlarge the display area.

Examiner Viewer provides these controls for viewing the graph. The right side buttons are:

view mode 

Toggles between a view-only mode (closed eye) and manipulation mode (open eye).

In view-only mode, the cursor appears as an arrow and the graph cannot be moved. Clicking on a portion of the graph selects the corresponding array element in the spreadsheet.

In manipulation mode, the cursor appears as a hand and you can move the graph. Dragging the graph with the left mouse button down moves the graph in any direction as if it were in a trackball; a quick movement spins the graph. Dragging the graph with the left mouse button and the ctrl button rolls (rotates) the graph in the plane of the screen. Dragging the graph with the middle mouse button moves it without changing the viewing angle.

If you drag the graph with both the left and middle mouse buttons down, the graph will appear to move into or out of the window (this is the same as the dolly thumbwheel which is described in this section).

Figure A-96. Examiner Viewer With Controls and Menus

Figure A-96  Examiner Viewer With Controls and Menus

help 

Runs a special help system containing Inventor Viewer information.

home 

Repositions the graph in its original viewing position.

set home 

Changes the home (original viewing) position for subsequent use of the home button.

view all 

Repositions the display area so that the entire graph is visible.

seek 

Provides a special cursor that lets you reposition the graph in the center of the display area or lets you center the view on a point you select with the cursor. See "Seek to point <or object>" in the Preferences dialog box.

These four controls let you move the graphic display:

x rotation thumbwheel 


Rotates the graph around its x-axis.

y rotation thumbwheel 


Rotates the graph around its y-axis.

zoom slider and readout 


Changes the size of the graph by scaling it.

dolly thumbwheel 


Changes the size of the graph and adjusts the angles to maintain perspective. The dolly control simulates moving the viewing camera back and forth with respect to the graph.

Examiner Viewer Menu

You access the Examiner Viewer menu (see Figure A-96) by holding down the right mouse button in the graphical display area. The Examiner Viewer menu provides these selections:

"Functions" 

Displays a submenu with the selections "Help," "Home," "Set Home," "View All," and "Seek," which are the same as the right mouse button controls described in the previous section, and the "Copy View" and "Paste View" selections. These operate like standard copy and paste editing commands, enabling you to transfer graphs.

"Draw Style" 

Displays a submenu that controls how the graph is displayed. The selections "as is," "filled," "wireframe," and "points" control how the graph is displayed when it is static. These override the Render menu selections. The selections "move wireframe" and "move points" control how the graph is displayed while in motion. The selections "single," "double," and "interactive" refer to buffering techniques used in moving the graph. These affect the smoothness of the movement.

"Viewing" 

The same as the view mode button described in the previous section. When it is off, you can select points from the graph to display in the spreadsheet but cannot move the graph. When on, it lets you manipulate the graph.

"Decoration" 

Displays the right side buttons when it is on and hides them when it is off.

"Headlight" 

Controls the shadow effect on the graph. When it is on, the light appears to come from the camera.

"Preferences" 

Causes the Examiner Viewer Preferences dialog box to display.

Figure A-97. Examiner Viewer Preferences Dialog Box

Figure A-97 Examiner Viewer Preferences Dialog Box

"Seek animation time" 


Lets you specify the time it takes for the graph to be repositioned after you change the seek point. See
"Seek to point <or object>."

"Seek to point <or object>" 


Lets you change the view of the graph to its center (object) or to a point in the graph that you specify with the seek cursor.

"Zoom slider ranges from" 


Lets you change the Zoom range, that is, the distance that the object appears to be away from the front of the window.

"Auto clipping planes" 


Centers the graph in your view if enabled. If disabled, it provides controls for removing data from visibility at either end of the z-axis. This is useful if you wish to focus on data above or below a set value.

"Enable spin automation" 


Lets you spin the graph. You grab the graph with the mouse, move it quickly in the desired direction, and release the mouse button. The graph spins as if in a trackball.

"Show point of rotation axes" 


Displays a set of three axes. You can move the graph around the x and y axes using the thumbwheel controls described in the previous section. When this option is on, you can set the size of the axes in pixels.

Call Stack View

The Call Stack View (Figure A-98) displays the functions in the call stack (referred to as frames) when the process has stopped.

Figure A-98. Call Stack View

Figure A-98 Call Stack View

The source display has two special annotations:

  • The location of the current program state is indicated by a large green (depending on color scheme) arrow representing the PC.

  • The location of the call to the function selected in the Call Stack View window is indicated by a smaller blue (depending on color scheme) arrow representing the current context, and the source line becomes highlighted.

The Call Stack View contains its own menu bar, which contains the Admin, Config, Display, and Help menus. The Admin menu is the same as that described in "Admin Menu". The Help menu is the same as that described in "Help Menu". The other menus are described in the following sections.

Config Menu

The Config Menu (Figure A-99) contains the following items:

"Preferences..." 


launchest the preference dialog (Figure A-99), which allows you the option of setting the maximum depth of the Call Stack View.

Figure A-99. Call Stack View Config Menu

Figure A-99 Call Stack View Config Menu

Display Menu

Figure A-100. Call Stack View Display Menu

Figure A-100 Call Stack View Display Menu

The Display Menu (Figure A-100) contains the following toggles:

"Arg Values" 

Allows you to set the argument values in the Call Stack View.

"Arg Names" 

Allows you to set the argument names in the Call Stack View.

"Arg Types" 

Allows you to set the argument types in the Call Stack View.

"Location" 

Allows you to set the function location in the Call Stack View.

"PC" 

Allows you to set the PC in the Call Stack View.

Expression View

The Expression View window is shown in Figure A-101. The expression view displays a collection of expressions that are evaluated each time the process stops or the context changes.

Figure A-101. Expression View

Figure A-101 Expression View

In addition to the items on the menu bar, the Expression View has two popup menus: the Language menu and the Format menu. The menu bar items and the two popup menus are discussed in the following sections. (The Admin menu is the same as that described in "Admin Menu". The Help menu is the same as that described in "Help Menu". The other menus are described in the following sections.)

Config Menu

Figure A-102. Expression View Config Menu

Figure A-102 Expression View Config Menu

The Config Menu (see Figure A-102) contains the following items:

"Load Expressions..." 


Launches the File menu (Figure A-49), allowing you to choose a source file from which to load your expressions.

"Save Expressions..." 


Launches the File menu (Figure A-49), allowing you to choose a file to which you can save your expressions.

Display Menu

Figure A-103. Expression View Display Menu

Figure A-103 Expression View Display Menu

The Display Menu (see Figure A-103) contains the following items:

"Clear All" 

Clears all fields in the view.

Language Popup

Figure A-104. Expression View Language Popup

Figure A-104 Expression View Language Popup

The Language popup (see Figure A-104) contains three radio buttons, allowing you to select one of three languages for evaluation: C, C++ or Fortran. The Language popup is invoked by holding down the right mouse button while the cursor is in the Expression column.

Format Popup

The Format popup (see Figure A-105) The Format menu is displayed by holding down the right mouse button in the Result column.

Figure A-105. Expression View Format Popup with Submenus

Figure A-105 Expression View Format Popup with Submenus

The Format popup contains the following items:

"Default" 

A radio button that sets the format to the default values.

"Value" 

Launches a submenu of radio buttons from which you can select a value of type Decimal, Unsigned, Octal, Hex, Float, Char, or String.

"Type" 

Launches a submenu of radio buttons from which you can select a type of Decimal, Octal, or Hex.

"Bit size" 

A radio button that sets the format to the bit size.

File Browser

The File Browser displays a scrollable list of source files used by the current executable. Double-click a file in the list to load it directly into the source display area in Main View or Source View. The Search field lets you find files in the list quickly.

Figure A-106. File Browser

Figure A-106 File Browser

The File Browser contains an Admin menu (described in "Admin Menu") and a Help menu (described in "Help Menu"). In addition, the browser has a Search field.

Structure Browser

The Structure Browser lets you examine data structures and the relationships of the data within them. It displays complex data structures as separate graphical objects, using arrows to indicate relationships. A typical Structure Browser example is shown in Figure A-107 with the Config, Display, Node, and Format menus displayed. (For a tutorial example of the Structure Browser, see "Examining Data".)

Figure A-107. Structure Browser With the Config, Display, Node, and Format Menus

Figure A-107  Structure Browser With the Config, Display, Node, and Format Menus

The structure name is entered in the Expression field. It then appears as an object or set of objects in the display area in the lower portion of the window. Each structure has a header identifying the structure, color coded by data type. Below the header are two columns: the left displays the field name and the right displays the field's value. If the structures to be displayed exceed the size of the Structure Browser window, scroll bars appear.

In addition to the Admin menu, Structure Browser provides four menus that are used to change the way the data displays. The menus are:

Config 

For saving and reusing type-specific formats and expressions. You can also set preferences regarding how objects of a given type are to be displayed.

Display 

Provides operations for all objects in the display area.

Node 

Provides operations for selected objects in the display area only.

Format 

Lets you change or reformat a specific value in the result column. It is a popup menu that is accessed by holding down the right mouse button while the cursor is over the result column.

Using the Overview Window to Navigate

WorkShop provides the Overview window (from the "Show Overview" selection in the Display menu) as another way to navigate around the display area (see Figure A-108).

Figure A-108. Structure Browser Overview Window

Figure A-108  Structure Browser Overview Window

The Overview window is a reduced-scale view of the requested structures. The structures are represented by solid rectangles color- coded by data type. The relative position of the currently visible area is represented by a transparent rectangle. This rectangle can be dragged (using the left mouse button) to change the display of the Structure Browser. Clicking the left mouse button in an area of the Overview window repositions the currently visible area.

Entering Expressions

The Structure Browser accepts any valid expression. If the result type is simple, a structure displays showing the type and value. If the result type is a pointer, it is automatically dereferenced until a non-pointer type is reached. If the result type is a structure or union, an object is displayed showing the structures' fields and their values. After the expression is entered, the Expression field clears. The Structure Browser can display unrelated structures at the same time—you simply enter new structures using the Expression field.

The Expression field is also used to enter strings used in searches.

Working in the Structure Browser Display Area

Within the display area, you select objects by clicking in the node headers. Shift-clicks add the selected object to the current selection. You can drag selected objects using the middle mouse button.

Clicking the right button while the cursor is in the right column of an object displays the Format menu, used to change the display of a specific result (see Figure A-109). You can set a default format or request that results be displayed by value, type, address, or size in bits.

Figure A-109. Structure Browser Format Menu

Figure A-109  Structure Browser Format Menu

Holding down the right button in the header of a Structure Browser object brings up the Node popup menu, which is the same as the Node Menu in the menu bar. It is used to change the way selected objects are displayed. When you left-click in the header of an object, it turns on the resizer, which lets you change the size of the object. Left-clicking the handle resizes; middle-clicking moves it.

Graphical arrows show the pointer relationships among the displayed structures. If a pointer field is not visible in a structure, its arrow tail is displayed at the top or bottom of the scrolling area for fields. Otherwise, its tail is adjacent to its field.

Double-clicking a value field (right column) for a pointer dereferences it, so that the data structure it points to is displayed.

Double-clicking a member field (left column) puts the full expression for that member in the Expression field.

Structure Browser Display Menu

The Display menu controls the way structures appear in the display area of Structure Browser. The menu is shown in Figure A-110.

Figure A-110. Structure Browser Display Menu

Figure A-110  Structure Browser Display Menu

The Display menu provides the following selections:

"Display"  

has two options:

  • "Expression" displays the structure of the expression entered in the Expression field.

  • "Selection" displays the structure based on the text from the current selection.

"Arrange"  

rearranges the currently selected nodes. There are two options (see Figure A-111):

  • "Tree" arranges them into a tree-type formation, that is, the hierarchy descends from left to right and child structures are shown as branches to the right of the parent.

  • "Linked List" arranges them into a linked list formation, that is, horizontally.

    Figure A-111. Tree and Linked List Arrangements of Structures

    Figure A-111 Tree and Linked List Arrangements of Structures

"Search"  

Lets you select structures containing the string specified in the Expression field. There are four options:

  • "Name" selects structures whose names contain the specified string.

  • "Type" selects structures whose types contain the specified string.

  • "Field Name" selects structures that have a field whose name contains the specified string.

  • "Value" selects structures that have a field value containing the specified string.

"Update" 

Explicitly updates the displayed structures. This happens automatically in the current Structure Browser when the process stops. This can be used in an inactive Structure Browser to update it. It can also be used to update the display after changes have been made in other Debugger views.

"Show Overview" 


Brings up the Overview window.

"Clear All" 

Clears all structures from the display area.

Node Menu

The Node menu is shown in Figure A-112.

Figure A-112. Structure Browser Node Menu

Figure A-112  Structure Browser Node Menu

The Node menu consists of the following entries and applies to the currently selected objects:

"State"  

Controls the display of nodes. There are three options:

  • "Iconic" displays the node header only.

  • "Normal" uses the default chart display but hides those fields selected to be invisible.

  • "Detail" uses the default chart display and shows all fields.

"Geometry" 

Manages graphical objects in the display area. There are four options:

  • "Minimize" sets the vertical size of an object to the default minimum number of fields. The initial default is four fields but can be changed through either the "Formatting" selection from the Node menu or the "Preferences..." selection from the Config menu.

  • "Maximize" displays the object as large vertically as necessary to fit all of the fields.

  • "Raise" raises the selected object(s) to the top of the display.

  • "Lower" lowers the selected object(s) to the bottom of the display.

"Select"  

Lets you select objects in various ways. There are six options:

  • "Parents" selects all objects that have pointers pointing to a selected object.

  • "Children" selects all objects pointed to by any fields in a selected object.

  • "Ancestors" selects all objects pointed to a selected object or pointing to an object that has a descendant pointing to a selected object.

  • "Descendants" selects all objects pointed to by any fields in a selected object or pointed to by any children of a selected object.

  • "Family" selects all ancestors and descendants of a selected object.

  • "All" selects all objects.

"Formatting" 

Brings up the type formatting dialog for this type. See "Formatting Fields."

"Dereference Ptrs" 


Dereferences any pointers in selected objects.

"Pattern Layout" 


Uses the spatial relationship between selected structures connected by pointers to position all similarly related structures in the same way.

"Remove" 

Removes the selected object from the display.

Formatting Fields

Each field in a data structure has certain display characteristics. These can be specified for all objects in the Structure Browser Preferences dialog box or for type-specific objects only in the Type Formatting dialog box. To display the Structure Browser Preferences dialog box, select "Preferences..." from the Config menu (see Figure A-113).

Figure A-113. Structure Browser Preferences Dialog Box

Figure A-113  Structure Browser Preferences Dialog Box

The Structure Browser Preferences dialog box has the following fields:

Default Structure Field Count 


Sets the number of fields to be displayed initially.

Default Structure Width 


The width in pixels of the object.

Default Iconic Width 


The width in pixels of the object when it is in iconic form.

Automatic Dereference Limit 


Sets a limit on the number of structures that are automatically dereferenced.

Dereference Ptrs By Default 


Lets you toggle automatic dereferencing on and off.

To bring up the Type Formatting dialog box, select the set of structures under consideration and select "Node Formatting" from the Node menu (see Figure A-114).

Figure A-114. Type Formatting Dialog Box

Figure A-114  Type Formatting Dialog Box

The Type Formatting dialog box has the following fields:

Type Name 

Displays the current data type.

Default Field Count 


The number of fields to be displayed initially for objects of that type.

Default Structure Width 


The width in pixels of the object.

Default Iconic Width 


The width in pixels of the object when it is in iconic form.

Default State 

Brings up a popup menu that lets you specify whether structures are first displayed as icons ("Iconic"), with the minimum number of fields displayed ("Normal") or with all fields displayed ("Detail").

Type Color 

Provides a submenu for color coding. It lets you select a color for the header and overview rectangles for objects of a given type.

For structure and union types, the list box shows all the fields with their types. For each field, you can change the result format to one of the following:

  • default

  • decimal

  • unsigned

  • octal

  • hex

  • float

  • char

  • string

  • type

  • dec addr

  • oct addr

  • hex addr

  • size in Bits

You can also specify whether a field is visible in normal state, and if it is a pointer field, whether it should be automatically dereferenced.

Once you specify the format for this type, you can apply it to any combination of the following through the toggle buttons in the bottom left portion of the window:

  • selected instances

  • all existing instances

  • any future instances of this type

Variable Browser

The Variable Browser lets you view and change the values of local variables and arguments at a specific point in a process. (Global variables can be viewed or changed using Expression View or the "Evaluate Expression" selection from the Data menu for one-shot evaluations.) In addition to providing the values, Variable Browser is useful for getting a quick list of the local variables in a scope without having to search for their names. A sample Variable Browser window with the Language and Format menus displayed is shown in Figure A-115. (For a tutorial example of the Variable Browser see "Examining Data".)

Typically, you inspect variable values

  • at a stop trap

  • at a frame in a call stack

  • as you step through a process


Note: A useful technique is to set a trap at the entry to a function and inspect the values of the variables there. Some variables may be in an uninitialized state at that point. You can then step through the function and make sure that no uninitialized variables are used inadvertently.


Entering Variable Values

The Variable Browser lets you change the values of variables in the window. You simply enter the new value in the result column and press <Enter>. Thus, you can force new values into the process and see their effect.

Figure A-115. Variable Browser With Language and Format Menus

Figure A-115 Variable Browser With Language and Format Menus

Changing Variable Column Widths

The Variable Browser has a sash between columns that lets you adjust the relative widths of the Variable and Result columns (see Figure A-115). For example, you may wish to adjust for short variable names and long result values.

Viewing Variable Changes

The Debugger views that are involved with variables (that is, the Variable Browser and Expression View) have indicators that show when the variable has changed since the last breakpoint. If you click the indicator, you can view the previous value. The variable change indicators for a Variable Browser window are shown in Figure A-116.

Figure A-116. Typical Variable Change Indicators

Figure A-116 Typical Variable Change Indicators

Machine-level Debugging Windows

The Debugger offers three views useful in debugging at the machine level; the Disassembly View, Register View, and Memory View.

Disassembly View

The Disassembly View of the Debugger lets you look at machine-level code rather than source-level code. A typical Disassembly View window appears in Figure A-117, with the Disassemble menu displayed.

Figure A-117. Disassembly View With Disassemble Menu Displayed

Figure A-117 Disassembly View With Disassemble Menu Displayed

Similarities With Main View

At the top of the window are the same process control buttons as those in Debugger Main View. They behave the same way except for Step Into and Step Over, which do machine-level instruction stepping instead of source-level. Remember that you select the number of steps by holding down the right mouse button over the Step Into and Step Over buttons.

The menus are basically the same as in Main View except for the Disassemble menu. The PC menu selections "Continue To" and "Jump To" are based on machine-level instructions rather than source-level steps. The Config menu has a "Preferences..." selection that brings up a dialog box oriented to Disassembly View.

You can set traps either by using the Traps menu or by clicking in the annotation column of the source display area that contains the disassembled code.

Disassemble Menu

Figure A-118. Disassemble Menu

Figure A-118 Disassemble Menu

The Disassemble menu (see Figure A-118) lets you display disassembled code. It contains the following items:

"Address..." 

allows you to disassemble a specified number of lines, starting from a specified source line address (see Figure A-119).

Figure A-119. Disassemble From Address Dialog Box

Figure A-119 Disassemble From Address Dialog Box

"Function..." 

allows you to disassemble a specified number of lines, starting from the beginning address of a specified function name (see Figure A-120).

Figure A-120. Disassemble Function Dialog Box

Figure A-120 Disassemble Function Dialog Box

"File..." 

allows you to disassemble a specified number of lines, starting from the address corresponding to a specified line number in a specified file (refer to Figure A-121). If you have a current selection in Main View or Source View, its file and cursor position are used as the default filename and line number, respectively.

Figure A-121. Disassemble File Dialog Box

Figure A-121 Disassemble File Dialog Box

Disassembly View Preferences

Selecting "Preferences..." from the Config menu brings up the Disassembly View Preferences dialog box (shown in Figure A-122) so that you can change the global preferences.

Figure A-122. Disassembly View Preferences Dialog Box with Format Popup Menu

Figure A-122 Disassembly View Preferences Dialog Box with Format Popup Menu

The dialog box provides you with these options:

Number of instructions to disassemble 


controls the default number of disassembly lines shown when the process stops. This number appears in the dialog boxes selected from the Disassemble menu (see Figure A-119, Figure A-120, and Figure A-121). The default is all instructions, indicating that the entire function will be disassembled.

Minimum lines around current instruction 


controls the display of the disassembled code, enabling you to view at least the specified number of instructions before and after the current instruction.

Register name display format 


controls how register names are displayed. The available modes are "Hardware," "Compiler," and "Assembler."

The Display Options selections control what information is shown in each disassembled line.

Show embedded source annotation 


turns on interleaved source lines in the appropriate positions.

Show source file and line number 


displays the filename and file position along with each machine instruction.

Show function name and line number 


displays the function name and file position along with each machine instruction.

Show machine address 


displays the memory address of each machine instruction.

Show instruction value 


displays the instruction word along with each machine instruction.

Show jal targets numerically 


controls whether the target address of a jal instruction is displayed as a hex address or symbolic label.

Register View

Register View lets you examine and modify register values. You bring it up by selecting "Register View" from the Views menu in Main View. Figure A-123 shows a typical Register View window that has been resized to show all available registers.

Register View displays each register with its current value. A question mark (?) displayed immediately before a register value signifies that the value is suspect; it may not be valid for the current frame. This can occur if a register is not saved across a function call. A colored marker indicates that a register value has changed since the last time the process stopped.

Figure A-123. Register View

Figure A-123 Register View

Register View Window

The major features of the Register View window are:

Current register field 


identifies the currently selected register. You can switch to a different register by entering its name (either by hardware name or by alias) in this field and pressing <Enter>. You can also switch registers by clicking on the new register in the display area.

Current register value field 


shows the contents of the selected register. You can assign a new value to a register by entering either a literal or an expression into the Value field. You then click on the Modify button to change the value or press <Enter>.

Register display area 


shows the registers organized into four groups: general, special, floating, and double. Note that the general registers are identified by both their hardware and software names. Double registers have a one-to-two correspondence with the floating registers.


Note: The special registers p0, p1, and p2 are empty in the figure. These are used for instrumentation and display values only when instrumentation has taken place.


Changing the Register View Display

The "Preferences..." selection in the Config menu lets you change the Register View display. It brings up the Register View Preferences dialog box (see Figure A-124).

The Register Display toggle buttons let you specify which types of registers are to be displayed by default.

Figure A-124. Register View Preferences Dialog Box

Figure A-124 Register View Preferences Dialog Box

The Register Formatting area lets you select formats for any of the registers. You have a choice of "default," "decimal," "octal," or "hex" format.

The default fields in the top row let you change the defaults for the four major types, which are set as follows:

  • general registers—hexadecimal

  • special registers—hexadecimal

  • float registers—floating point

  • double registers—floating point

The rows in the register formatting area let you change the modes for the individual registers.

Memory View

Memory View lets you examine and modify memory. A typical Memory View window appears in Figure A-125.

Figure A-125. Memory View With Mode Menu Displayed

Figure A-125 Memory View With Mode Menu Displayed

Viewing a Portion of Memory

To view a portion of memory, enter the beginning memory location in the Address field. You can enter the literal value or an expression that evaluates to an integer address. These address specifications must be in the language of the current process as indicated by the call stack frame. For example, you can enter 0x7fff4000+4 as the memory address when stopped in a C function or enter $7fff4000+4 as the equivalent for a Fortran routine. Press <Enter> while the cursor is in the field or click the View button to display the contents of that location and the subsequent locations in the display area. This also displays the contents of the first address in the Value field where it can be modified.

The memory display area shows the contents of individual byte addresses. The column at the left of the display shows the first address in the row. The contents at that address are shown immediately to its right, followed by the contents of the next seven byte locations. If you enlarge the Memory View window, you can see additional rows of memory.

Changing the Contents of a Memory Location

To change the contents of a memory location, you select the address to be changed, either by direct entry or by clicking on the byte value in the display area. You can enter a single value or a sequence of hex byte values separated by spaces (for example, 00 3a 07 b2) in the Value field. You can also enter a quoted string to change a consecutive range of values to the ASCII values of that string. Pressing <Enter> while the cursor is in the Value field or clicking the Modify button substitutes the new value(s) starting at the specified location.

Changing the Memory Display Format

The Mode menu lets you change the format of the value field or byte locations to either decimal, octal, hex, or ASCII.

Moving around the Memory View Display Area

The four control buttons at the upper right of the window help you move around the display area. These buttons are:

Up 

for moving the displayed bytes up a single row.

Down 

for moving the displayed bytes down a single row.

Page Up 

for moving the displayed bytes upward by as many rows as are currently displayed.

Page Down 

for moving the displayed bytes downward by as many rows as are currently displayed.

Multiple Process Debugging Windows

WorkShop supports performance analysis and debugging of multiprocess applications, including processes spawned either with fork or sproc. Multiprocess debugging is supported primarily through the Multiprocess View.

Multiprocess View

Select "Multiprocess View" from the Admin menu to bring up Multiprocess View. Main View is attached to the parent process. Figure A-126 shows a typical Multiprocess View with Config and Process menus displayed.

Figure A-126. Multiprocess View with Config and Process Menus Displayed

Figure A-126 Multiprocess View with Config and Process Menus Displayed

To open a Main View (or other debugging views) for another process, double-click the desired process in Multiprocess View. A separate Main View window displays the selected process, and you can select any debugging views desired. If a set of views exists for that process, the views are raised to the foreground. To reuse views already displayed, select "Switch Process..." from the Admin menu in Main View. (If a process is currently highlighted in Multiprocess View, its id is entered automatically in the Process id: field in the Switch Process dialog box.)

Viewing Process Status

When Multiprocess View comes up, it lists the status of all processes in the process group. This information includes:

PID: 

shows the process identifier (id).

PPID: 

lists the parent process ids. Notice in Figure A-126 that the first process PID#7748 is the parent process of the second.

State: 

represents the state of the process: stopped, running, or created, which appears just prior to running. Terminated processes are not displayed.

Name: 

identifies the process by filename.

Function/PC: 

indicates the current function and program counter (PC) for any stopped processes.

Multiprocess Control Buttons

Multiprocess View uses the same control buttons as MainView with two exceptions. The buttons are applied to all processes as a group. There is no separate Run button. Using a control button in Multiprocess View has the same effect as clicking the button in each process's Main View window. The buttons are:

Continue 

resumes program execution after a halt and continues until a stop trap or other event stops execution.

Stop 

stops execution of all processes. When program execution stops, the current source line of each process is highlighted in its Main View, if one is active, and annotated with an arrow indicating the PC.

Step Into 

steps to the next source line and into function calls. To step a specific number of lines, hold down the right mouse button over the Step Into button. A popup menu displays that lets you select one of the fixed values or a specified number of steps.

Step Over 

steps to the next source line and over function calls. To step a specific number of lines, hold down the right button over the Step Over button. A popup menu displays that lets you select one of the fixed values or a specified number of steps.

Return 

executes the remaining instructions in the current function. Program execution stops upon return from that procedure.

Sample 

collects performance data for each process (if performance data collection is enabled).

Kill 

terminates all processes in the group.

Multiprocess Traps

As discussed in Chapter 4, "Setting Traps," the trap qualifiers [all] and [pgrp] are used in multiprocess analysis. The [all] entry stops or samples all processes when a trap fires. The [pgrp] entry sets the trap in all processes within the process group containing the trap location. The qualifiers can be entered by default by the "Group Trap Default" and "Stop All Default" selections in the Traps menu in Trap Manager.

Note that the Sample button always samples all processes.

Adding and Removing Processes

Figure A-127. Process Menu in Multiprocess View

Figure A-127 Process Menu in Multiprocess View

The Process menu lets you manually add or remove a process from the process group (see Figure A-127).

To remove a process, click the process and select "Remove" from the Process menu. Note that a process in a sproc share group cannot be removed from the process group.

To add a process, select "Add..." The dialog box shown in Figure A-128 displays. Enter the new process id and click OK.

Figure A-128. Add Process Dialog Box

Figure A-128 Add Process Dialog Box

Multiprocess Preferences

The "Preferences..." option in the Config menu brings up the Preferences dialog box. It lets you control when processes are added to the group, and it specifies their behavior (see Figure A-129).

Figure A-129. Multiprocess View Preferences Dialog Box

Figure A-129 Multiprocess View Preferences Dialog Box

The Multiprocess View preference options are:

Attach to forked processes 


attaches new processes spawned by the fork command to the group automatically. (Note that processes spawned by sproc are always attached.)

Copy traps to forked processes 


copies traps you have set in the parent process to new forked processes automatically. If you create parent traps with Trap Manager and specify pgrp, then the children inherit these traps automatically, regardless of the state of this flag.

Copy traps to sproc'd processes 


copies traps you have set in the parent process to new sproc'd processes automatically. As in the previous option, if you create parent traps with the Trap Manager and specify pgrp, the children inherit these traps automatically, whether this flag is set or not.

Resume parent after fork 


restarts the parent process automatically when a child is forked.

Resume child after attach on fork 


restarts the new forked process automatically when it is attached. If this option is left off, a new process will stop as soon as it is attached.

Resume parent after sproc 


restarts the parent process automatically when a child is sproc'd.

Resume child after attach on sproc 


restarts the new sproc'd process automatically when it is attached. If this option is left off, a new process will stop as soon as it is attached.

Fix+Continue Windows

The Fix and Continue GUI affects several WorkShop windows and provides three more. The Debugger and Source View access the Fix and Continue utility from the menu bar. The results of running redefined code are displayed in the Debugger Execution View. Special line numbers (decimal notation) applied to redefined functions appear in several WorkShop views (refer to "Changes to Debugger Views"). Fix and Continue comes with three windows devoted entirely to Fix and Continue: Status, Message, and Build Environment. This section describes Fix and Continue menu selections and these windows.

The Fix and Continue menu is available from the Debugger Main View menu bar, as shown in Figure A-130. The menu selections operate on the selected function or on the file shown in the source view. The Fix and Continue menu is also available from Source View and from the Fix and Continue Status window.

Figure A-130. Fix+Continue Menu Selections

Figure A-130 Fix+Continue Menu Selections

Fix+Continue Status Window

This section describes the Fix+Continue Status window (see Figure A-131). The Status window provides you with a summary of the modifications that you have made during your session. It also allows you quick access to your modified functions, and a somewhat expanded Fix+Continue menu.

Figure A-131. Fix+Continue Status Window

Figure A-131 Fix+Continue Status Window

The function ID number, status, name, and filename are displayed in the Status window. Double-clicking a line item in the status window brings up the corresponding source in the Debugger main window.

The menus and submenus that provide you with extra functionality through the Status window (see Figure A-132) are described below.

Figure A-132. Fix+Continue Status Window Menus

Figure A-132 Fix+Continue Status Window Menus

Admin Menu

Figure A-133. Status Window Admin Menu

Figure A-133 Status Window Admin Menu

The Admin menu (see Figure A-133) contains an option for closing the window.

"Close" 

Closes the Status window.

View Menu

Figure A-134. Status Window View Menu

Figure A-134 Status Window View Menu

The View menu (see Figure A-134) contains options for sorting the information in the window, and displaying filenames.

"Sort Status View" 


Sorts the information in the status view according to the field currently selected.

"Show Long Filenames" 


A toggle that allows you to show the absolute (long) pathnames, relative pathnames, or base names.

Fix+Continue Menu

Figure A-135. Status Window Fix+Continue Menu

Figure A-135 Status Window Fix+Continue Menu

The Fix+Continue menu (see Figure A-135) that is available from the Status view is somewhat different from that available through the Debugger main view. It contains a number of options and submenus, which are all described below. These options and submenus are active on the function that you select in the Source view. You can select a function by clicking on it.

"External Editor" 


Allows you to edit with an external editor such as vi, rather than the Debugger's default editor.

"Parse And Load" 


Parses your modified function and loads it for execution. You can execute the modified function by clicking on the Run or Continue buttons in the Debugger main view.

Update All Files..." 


Launches the "Save File+Fixes As..." dialog (see Figure A-25), which allows you to update the current session, saving all the modified functions to the appropriate files.

"Show Difference" submenu (see Figure A-136) 


Allows

Figure A-136. Show Difference Submenu

Figure A-136 Show Difference Submenu

you to show the difference between the original source and your modified code. You can show the difference in the code in one of the two following ways:

  • "For Function" shows the differences for the current function only.

  • "For File" shows the differences for the entire file that contains the current function.

"Enable" submenu (see Figure A-137) 


Allows

Figure A-137. Enable Submenu

Figure A-137 Enable Submenu

you to enable the changes in your modified code in one of the three following ways:

  • "Function" enables the changes in the current function.

  • "Functions in File" enables the changes to the current function in its own file.

  • "All Functions" enables the changes to all functions in the modified code.

"Disable" submenu (see Figure A-137) 


Has the same menu choices as the "Enable" submenu, but disables rather than enables.

"Save" submenu (see Figure A-138) 


Allows

Figure A-138. Save Submenu

Figure A-138 Save Submenu

you to save your code changes to a file. You can save the changes in one of the three

Figure A-139. File Dialog

Figure A-139 File Dialog

following ways:

  • "Function..." launches the File dialog (see Figure A-139), allowing you to save only the current function to a file.

  • "File..." launches the "Save File+Fixes As..." popup window (see Figure A-25), allowing you to save the entire file that contains the current function.

"Delete" submenu (see Figure A-137) 


has the same menu choices as the "Enable" submenu, but deletes rather than enables.

"Show" submenu (see Figure A-140) 


Allows

Figure A-140. Show Submenu

Figure A-140 Show Submenu

you to launch any of the following three different Fix and Continue windows:

  • "Message Window" launches a Message window for the selected function. See "Fix+Continue Message Window" for more details.

  • "Build Env for File" launches a Build Environment window for the file shown in the Source View. See "Fix+Continue Build Environment Window" for more details on the Build Environment window.

  • "Default Build Env" launches the Build Environment window to show the options that are to be used in cases where they could not be obtained from the target. See "Fix+Continue Build Environment Window" for details on the Build Environment window.

Fix+Continue Message Window

The Fix+Continue Message window (see Figure A-141) contains a list of any errors and other system messages that pertain to your source modifications, parses, and attempts to run your modified source.

Figure A-141. Fix+Continue Message Window

Figure A-141 Fix+Continue Message Window

You can highlight the source line where the error occurred by double-clicking the appropriate line in the Message window. The window contains the following buttons:

Clear 

Clears all the parsing errors and warnings.

Next 

Puts a tick mark on the next unticked error warning entry in the parse messages. It displays the corresponding file and line in the Source view, highlighting it according to the type of error or warning. Next doesn't function after all the entries in the messages are ticked.

Rescan 

Erases all the ticks, so that you can rescan all the error warnings from the beginning.

The added functionality available through the Message window's Admin and View menus is described below.

Admin Menu

The Admin menu allows you to perform either of the following two operations:

"Clear All" 

Clears all messages in the Message window.

"Close" 

Closes the window.

View Menu

The View menu allows you to set any of the following three toggles:

"Show Warnings" 


Causes compile warnings to be displayed in the parse errors list.

"Append Parse Messages" 


Causes parse messages to be appended to the parse errors list.

"Append Load Messages" 


Causes load messages to be appended to the load errors list.

Fix+Continue Build Environment Window

This section describes the Fix+Continue Build Environment window (see Figure A-142). The Build Environment window provides you with the build information for your source code in your current environment. It displays the command that was used to build your executable and the name of the file that contains the function that you currently have selected.

Figure A-142. Fix+Continue Build Environment Window

Figure A-142 Fix+Continue Build Environment Window

The compiler and associated flags that were used to compile the file are normally gathered from the target. You can use the Build Environment window to make any changes to these flags.

The Build Environment window allows you to select your build environment setting through the "Build Environment Setting" toggle, which contains the two options described below:

"Default" 

Sets the build environment to default that is displayed in the Build Environment window.

"File Specific" 

Sets the build environment to that of the file that contains the currently selected function. You can change the file by clicking the Select File button, which launches the File dialog (see Figure A-139).

The Build Environment window also contains the following buttons:

Select File 

Launches the File dialog and allows you to select a file from which to set the build environment.

Clear 

Clears the window.

Set 

Sets the build environment to what is displayed in the window.

Unset 

Unsets the build environment.

Done 

Dismisses the window.

Changes to Debugger Views

When you use Fix and Continue, Debugger views change to show redefined functions or stopped lines containing redefined functions.

Main View

When you open the Debugger after installing Fix and Continue, you'll notice several changes to the environment. All Fix and Continue functions are available through the Fix+Continue menu. See Figure A-143 for details.

Figure A-143. Debugger Main View

Figure A-143 Debugger Main View

You select Fix and Continue commands from the Fix+Continue menu or enter them at the Debugger command line. The source code status is Read Only. Color coding shows the differences between editable code, enabled redefinitions, disabled definitions, and breakpoints. Line numbers in redefined functions have decimal notation that is used for every reference to the line number. The integer portion of the decimal is the same as the first line of the function. This ensures that compiled source code line numbers remain unchanged.

Command-Line Interface

The Debugger command-line interface accepts Fix and Continue commands and reports status involving redefined functions or files. Figure A-144 shows a function successfully redefined using the command line. Change id 1 was previously redefined and assigned the number 1.

Figure A-144. Command-Line Interface With Redefined Function

Figure A-144 Command-Line Interface With Redefined Function

Call Stack

The Call Stack View recognizes redefined functions. It uses the decimal notation for line numbers, as shown in Figure A-145.

Figure A-145. Call Stack

Figure A-145 Call Stack

Trap Manager

The Trap Manager recognizes redefined functions. It uses the decimal notation for line numbers, as shown in Figure A-146.

Figure A-146. Trap Manager With Redefined Function

Figure A-146 Trap Manager With Redefined Function

Debugger Command Line

To use the Debugger commands, which are entered at the command line at the bottom of Main View (see Figure A-1), you should be familiar with dbx commands. For more information, refer to the dbx Reference Manual. The syntax for the debugging commands is as follows:

add_source {"filename":line_number} 


Prompts you to add source code lines (for example, add_source "fmain.c":15.2). line_number must be within the body of a function. Entering a period (.) specifies the end of your input. The source lines you provide are added after the specified line. This command returns an ID existing or new, depending on whether the function affected has already been changed or not. The resulting new definition of the function is executed on its entry next time. See also delete_source, replace_source.

alias [shortform command] 


Lists all aliases without arguments. With arguments, it assigns command to shortform.

assign expression1=expression2 


Assigns expression2 to expression1.

attach pid 

attaches to specified process ID pid.

call function_name [argument, ...] 


Executes the specified function with any arguments supplied.

catch [signal_name | all] 


With no arguments, lists signals to be trapped. If a signal is specified, it's added to the list. If all is specified, it traps all signals.

clear [all | source_line] 


Clears breakpoints. The all option clears all breakpoints. The source_line option clears the breakpoint at the specified source line.

clearbuffer 

Clears the currently displayed lines.

clearcalls 

Cancels pending interactive function calls.

cont in function_name 


Continues execution from the current line to the entry to the specified function.

cont to line_number 


Continues execution from the current line until the specified line.

continue 

Continues executing a program after a breakpoint. Note that you can c and cont as aliases for continue.

continue [signal] 


Sends specified signal and continues executing a program after a breakpoint.

corefile [filename] 


With no arguments, reports whether data referencing commands reference a core file. If so, displays the current core file. With filename provided, specifies core file to be debugged.

delete displaynumber [,displaynumber, ...] 


Deletes the specified expression from the display list.

delete all 

deletes all traps.

delete_changes {func_spec | -all | {-file filename}} 


Undoes the changes corresponding to the selected functions (for example, delete_changes getNumbers -file fmain.c). Once deleted, you won't be able to use the IDs again, since the IDs associated with the selected functions are released. The default is -all. See also save_changes.

delete_source {"filename":line_number[,line_number]} 


Deletes the given line(s) if line_number or ,line_number (range) is within the body of a function. An example is: delete_source "fmain.c":8.6,8.7. This command eturns an ID existing or new, depending on whether the function affected has already been changed or not. The resulting new definition of the function is executed on its entry next time.

delete trap_number [,trap_number, ...] 


Deletes the specified breakpoint from the status list.

detach 

Detaches from the current process.

disable all 

Deactivates all inactive traps.

disable_changes {func_spec | -all | {-file filename}} 


Undoes changes specified for the selected functions (for example, disable_changes getNumbers -file fmain.c. Nothing happens if the selected function is already disabled. The compiled definition of the function is executed on its next entry. You can invoke this command when the process is stopped or on a running process when a function entry breakpoint is set.

disable trap_number [,trap_number, ...] 


Deactivates a trap set by stop command.

display [expression, ...] 


With expression, adds expression to the list of expressions displayed whenever the process stops. With no arguments, lists all expressions on the display list.

down [expression] 


Moves down the specified number of frames in the call stack. down moves in the direction of the called function.

dump 

Prints local variable values.

enable all 

Reactivates all inactive traps.

enable_changes {func_spec | -all | {-file filename}} 


Redoes changes specified for the selected functions (for example, enable_changes getNumbers -file fmain.c. Nothing happens if the selected function is already enabled. The latest accepted definition of the function is redefined on its next entry. You can invoke this command when the process is stopped or on a running process when a function entry breakpoint is set.

enable trap_number [,trap_number, ...] 


Reactivates a disabled stop trap.

expression/[count] [format] or expression,[count] /[format]  


Prints the contents of the memory address specified by expression, according to the specified format. count represents the number of formatted items. The format options are:

d prints a short word in decimal
D prints a long word in decimal
o prints a short word in octal
O prints a long word in octal
x prints a short word in hexadecimal
X prints a long word in hexadecimal
b prints a byte in octal
c prints a byte as a character
s prints a string of characters that ends in a null byte
f prints a single-precision real number
g prints a double-precision real number

file [filename] 


Displays the name of the current or specified file (filename). If a file is specified, it becomes the current file.

func [func_name] 


Moves to the source code corresponding to the specified frame in the call stack or to the function in the executable if not on the stack.

givenfile [filename] 


With no arguments, displays name of current object file. With filename, specifies object file to be debugged.

goto linenumber 


Goes to the specified line number.

ignore [signal_name | all] 


With no arguments, lists those signals not to be trapped. If a signal is specified, this command removes it from the list of signals to be trapped. If all is specified, ignores all signals.

kill [pid] 

Kills the specified process currently controlled by the Debugger.

list [[expression [,expression]] | [function_name]] 


Lists the specified number (expression) of lines. The default is 10 lines. You can optionally specify a function where the list is to take place.

list_changes [func_spec | -all | {-file filename}] 


Lists one or more lines using the following syntax:

change_id isEnabled filename function_spec

For example:

4 enabled foo.c foo
8 disabled A.c++ A::bingo

The default is list_changes -all.

next [INT] 

Steps over the specified number of source instructions. This command does not step into procedures. The default is one instruction.

nexti [INT] 

Steps over the specified number of machine instructions. This command does not step into procedures. The default is one line.

print expression [,expression, ...] 


Prints the value of the specified expression(s). If the expression is a character pointer or array, both the string and address print.

printd expression [,expression, ...] 


Prints the value of the specified expression(s) in decimal format. You can use pd as an alias.

printo expression [,expression, ...] 


Prints the value of the specified expression(s) in octal format. You can use po as an alias.

printregs 

Prints the contents of the registers.

printx expression [,expression, ...] 


Prints the value of the specified expression(s) in hexadecimal format. You can use px as an alias.

pwd 

Sisplays the current directory.

quit 

Exits the debugging session.

redefine func_spec 


[-edit |
{ -read
filename[line_number,line_number]}]
Specifies a new body for a function. The new definition is checked, and errors (if any) are printed. The new function body is redefined on the next function entry. Breakpoints (if set) on the old definition are put on the new definition based on their relative line number position from the beginning of the function definition. (Note that some breakpoints may not make it to the new definition.) You can invoke this command when the process is stopped or on a running process when a function entry breakpoint is set. There are three ways to provide a new definition:

  • -edit pops up an editor of your choice containing the current definition of the function. The specification of the new definition is complete when you exit the editor. You may not leave the editor open. Figure A-147 shows the vi editor.

    Figure A-147. Editing a Function in the vi Editor

    Figure A-147 Editing a Function in the vi Editor

  • -read takes the contents of the file specified (within the line numbers if given) as the new function definition.

  • No option allows you to type in replacement code from the next line. A period in the first column on a fresh line terminates the definition. For example:

    redefine getNums"/usr/fmain.c":8.1> {"/usr/fmain.c":8.2> printf("In getNums.\n");"/usr/fmain.c":8.3> }"/usr/fmain.c":8.4> .

    You can use a combination of characters (yet to be determined) to open an editor of your choice containing the lines typed. The specification of the new definition is complete when you exit the editor.

replace_source {"filename":line_number[,line_number]} 


Prompts you to type in replacement source if line_number or ,line_number (range) is within the body of a function. The source lines you provide replace the specified line(s). An example is replace_source "fmain.c":12. This command returns an existing or new id depending on whether the function affected has already been changed or not. The resulting new definition of the function is executed on its entry next time. See also add_source and delete_source.

rerun 

Runs the program again using the same arguments.

return 

Continues executing the current procedure and returns to the next sequential line in the calling function.

run 

Runs the program.

runtime_check func_spec [-options key [key,...]] 


Enables all run-time checking options by default. If -options is specified then run-time checking is restricted to the keys. The result of the checks selected will be printed when the specified function is entered next time. You can invoke this command when the process is stopped or on a running process where a break point is set at function entry.

key = [[+|-] runtime_check option key]
For example:

A unique identifier (key) is returned whenever you specify a function as an argument for runtime_check.

save_changes {func_spec | {-file filename}}  


[-[w|a]]filename_to_save
Saves (enabled or disabled) function redefinitions or an entire file to a separate file (filename_to_save). An example of saving a function definition is the following:

save_changes getNumbers getNumbersFunc

If you specify the -file option, then before saving to filename_to_save, all function changes are applied to the compiled source of the file (with the condition that the file has had only its functions redefined, and has not been edited since the last build). An example of saving an entire file is the following:

save_changes -file fmain.c fmain.c

-w replaces the filename_to_save. -a appends to the file_to_save. An example of adding a function to a file is the following:

save_changes getNumbers -a newFuncs

See also delete_changes.

setbuildenv ["filename"] compiler-flag-list 


Overrides default build environment flags (compiler options). Without filename, the flags are passed along with -c -g flags to the compiler for any function in any file except those set separately with setbuildenv. An example is the following:

setbuildenv -DnameA -IdirIf filename is given, this command sets separate flags specifically for that file. For example, consider the following: 
setbuildenv "fermat.c" -DnameB -Ianotherdir

See also unsetbuildenv.

sh [shell_command] 


Call a shell if no arguments; otherwise, executes the specified shell command.

showbuildenv ["filename"] 


Lists all the build environment flags set so far. showbuildenv"filename" lists any build environment specs set separately with setbuildenv"filename".

show_changes [func_spec | -all | {-file filename}] 


Prints the code of all enabled redefinitions of the specified function(s). The default is show_changes -all. See also enable_changes and disable_changes.

show_diff {func_spec | {-file filename}} 


Launches a xdiff comparing the compiled source and its latest redefinition for the specified function. If -filefilename is specified, xdiff shows the difference between the compiled file and the file with all redefinitions applied to the compiled source of the file (with the condition that the file has had only its functions redefined, and has not been edited since the last build).

source filename 


Executes commands in the specified file.

status 

Displays a list of currently set breakpoints and traces.

step [INT] 

Steps the specified number of source instructions. This command steps into procedures. The default is one instruction.

stepi [INT] 

Steps the specified number of machine instructions. This command steps into procedures. The default is one line.

stop at [filename:] line_number [if expression] 


Traps at the specified line in the specified file. If the if option is used, the trap fires only if expression is true.

stop in [filename:] function_name [if expression] 


Traps at the entry to the specified function. If the if option is used, then the trap fires only if expression is true. If the filename is given, the function is assumed to be in that file's scope.

syscall catch | ignore [call | return] \ 


[sys_call_name | all]
The catch option adds a system call to the list of system calls to be trapped. The ignore option removes a system call from the system call trap list. The call option specifies the entry to the system call and return signifies the return from the call.

trace [variable] at [["filename":] \ 


[line_number | function_name] \
[if
expression]]
Traces the specified variable. You can specify a file and/or test condition. You can also specify a line number or a function where the trace is to take place.

unalias aliasname 


Cancels the alias specified as aliasname.

undisplay [displaynumber, ...] 


Stops display of expression with specified displaynumber when the process stops. Removes the expression from the display list.

unsetbuildenv ["filename"] 


Disregards the default build environment flags if specified earlier. For all functions in files that don't have an overriding build environment, unsetbuildenv passes only the -c and -g flags.

If filename is given, this command disregards the build environment flags specified for the file earlier. Further redefinition of the functions in the file use the default build environment flags, if set. See also setbuildenv.

up [expression] 

Moves up the specified number of frames in the call stack. up moves in the direction of the caller.

use [path] 

uses the specified path to search for source files.

whatis identifier 


Displays all the qualifications of the specified variable.

when at [filename:] line_number {command [; command ...]} 


Stops the process and performs other Debugger commands when the process reaches a specified line number.

when in [filename:] function_name {command [; command ...]} 


Stops the process and performs other Debugger commands at entry to function. If the filename is given, the function is assumed to be in that file's scope.

which identifier 

Displays the qualification of the specified variable.

where 

Performs a stack trace.