This chapter describes in detail the function of each window, menu, and display in the Fix and Continue utility's graphical user interface (GUI). In addition, the chapter describes the Fix and Continue commands available on the Debugger command line (see “Command-Line Interface”). Most commands are available from either interface. You can move from one to the other as you prefer. For a task-oriented introduction to commonly-used functions, see Chapter 3, “Using Fix and Continue: A Sample Session.”
With Fix and Continue, the Debugger is in the “Edit” state by default. This means that you may select a function for editing, redefine, check syntax, and run the program. You can work with several redefinitions, selectively enabled or disabled.
This chapter contains the following sections:
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 4-1. 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.
| “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“ |
| |
| “Cancel Edit” | Takes you out of edit mode. | |
| “Show Difference“ submenu |
| |
| “Edited<-->Compiled“ |
| |
| “Delete All Edits“ |
| |
| “Save File+Fixes As...“ |
you to save your changes to a file (see Figure 4-3). You can save the changes to the current source file (the default), or to a separate file. | |
| “Update All Files...” |
| |
| “View“ submenu |
| |
| “Preferences” submenu |
|
| “For Function” |
| |
| “For File” | Opens a window that shows you the differences between the original source file and your modified version. | |
| “Set Diff Tool ...” |
|
| “Status Window” |
| |
| “Message Window” |
| |
| “Build Environment Window” |
|
| “Show Preferences” |
| |
| “Reset Factory Defaults” |
| |
| “Save Preferences” |
| |
| “Load Preferences...” |
|
This section describes the Fix+Continue Status window (see Figure 4-8). 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.
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 4-9) are described below.
| “Close” | Closes the Status window. |
| “Sort Status View” | | |
| “Show Long Filenames” |
|
| “External Editor” |
| |
| “Parse And Load” |
| |
| Update All Files...” |
| |
| “Show Difference” submenu (see Figure 4-13) |
| |
| “Enable” submenu (see Figure 4-14) |
| |
| “Disable” submenu (see Figure 4-14) |
| |
| “Save” submenu (see Figure 4-15) |
| |
| “Delete” submenu (see Figure 4-14) |
| |
| “Show” submenu (see Figure 4-17) |
|
The Fix+Continue Message window (see Figure 4-18) contains a list of any errors and other system messages that pertain to your source modifications, parses, and attempts to run your modified source.
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.
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. |
The View menu allows you to set any of the following three toggles:
| “Show Warnings” |
| |
| “Append Parse Messages” |
| |
| “Append Load Messages” |
|
This section describes the Fix+Continue Build Environment window (see Figure 4-19). 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.
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 4-16). |
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. |
Use the accelerators in Table 4-1 to issue Fix+Continue commands directly from the keyboard.The accelerators are listed alphabetically by command.
Table 4-1. Fix and Continue Keyboard Accelerators
Command | Ctrl + key |
|---|---|
Cancel Edit | U |
Edit | E |
External Edit | X |
Parse And Load | P |
When you use Fix and Continue, Debugger views change to show redefined functions or stopped lines containing redefined functions.
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 4-20 for details.
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.
The Debugger command-line interface accepts Fix and Continue commands and reports status involving redefined functions or files. Figure 4-21 shows a function successfully redefined using the command line. Change id 1 was previously redefined and assigned the number 1.
The Call Stack View recognizes redefined functions. It uses the decimal notation for line numbers, as shown in Figure 4-22.
The Trap Manager recognizes redefined functions. It uses the decimal notation for line numbers, as shown in Figure 4-23.
The commands in this section let you work with Fix and Continue from the Debugger command line. Command arguments that are used for more than one command are grouped and documented separately in the next section. They are listed in alphabetical order for quick lookup.
This section contains descriptions of some Fix and Continue flags and variables that are common to more than one command.
| [-all] | Specifies existing changes. | |||
| [change_id] | A unique identifier (ID number) returned on the Debugger command line the first time you redefine a function. From then on, you can use the ID to refer to the function. Disabling or enabling the ID undoes or redoes the cumulative changes performed on the function. | |||
| [-file] | Specifies the following source file (filename); for example: -file fmain.c | |||
| [filename] | Specifies a filename with an extension such as .h, .c, or .CC | |||
| [func_spec] | Specifies a function using the following syntax:
where function_signature is the name of the function. A C++ member function includes the class name and scope resolution operator (::). For example:
| |||
| [line_number] |
|
| add_source {“filename”:line_number} |
| ||||
| delete_changes {func_spec | -all | {-file filename}} |
| ||||
| delete_source {“filename”:line_number[,line_number]} |
| ||||
| disable_changes {func_spec | -all | {-file filename}} |
| ||||
| enable_changes {func_spec | -all | {-file filename}} |
| ||||
| list_changes [func_spec | -all | {-file filename}] |
For example:
The default is list_changes -all. | ||||
| redefine func_spec |
| ||||
| replace_source {“filename”:line_number[,line_number]} |
| ||||
| save_changes {func_spec | {-file filename}} |
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:
-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:
See also delete_changes. | ||||
| setbuildenv [“filename”] compiler-flag-list |
See also unsetbuildenv. | ||||
| showbuildenv [“filename”] |
| ||||
| show_changes [func_spec | -all | {-file filename}] |
| ||||
| show_diff {func_spec | {-file filename}} |
| ||||
| unsetbuildenv [“filename”] |
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. |