12

Customization



12.1    Introduction

Tornado not only allows you to customize the appearance of the display to match your preferences, but it also allows you to add menu entries for other tools you may wish to use. The Options entry in the Tools menu displays commands that change the fonts, colors, editor settings, and other defaults for Tornado. The Customize entry in the Tools menu opens a dialog box for adding menu items.



12.2    Toolbars and Status Bar

Use the View>Toolbars menu item to customize the toolbars that are displayed in the IDE. All toolbars can be floating or docked. Each menu item acts as a toggle to display or hide the specified toolbar. The options are:

Standard Toolbar

Launch Toolbar

Debug Toolbar

WindView Toolbar

Build Toolbar

Use the View>Status Bar menu item to toggle display of the status bar at the bottom of the Tornado window.



12.3    Setting Options

You can specify the various default options that Tornado uses through the Options entry in the Tornado Tools menu.

12.3.1   Setting Download Options

The Download page provides options for handling symbols when objects are downloaded to the target (Figure 12-1).

Figure 12-1:   Download Page

The options are as follows:

System Symbol Table

LOAD_LOCAL_SYMBOLS
Only local symbols are added to the system symbol table

LOAD_GLOBAL_SYMBOLS (default)
Only external symbols are added to the system symbol table

In order to obtain the other symbol options, you can:

  • Check nothing, the equivalent of LOAD_NO_SYMBOLS, which adds no symbols to the system symbol table.

  • Check both boxes, the equivalent of LOAD_ALL_SYMBOLS, which adds all symbols to the system symbol table.

Common Symbol Resolution

LOAD_COMMON_MATCH_NONE
Allocate common symbols, but do not search for any matching symbols (the default)

LOAD_COMMON_MATCH_USER
Allocate common symbols, but search for matching symbols in user-loaded modules

LOAD_COMMON_MATCH_ALL (default)
Allocate common symbols, but search for matching symbols in user-loaded modules and the target-system core file

C++ Constructors

LOAD_CPLUS_XTOR_AUTO (default)
C++ ctors/dtors management is explicitly turned on

LOAD_CPLUS_XTOR_MANUAL
C++ ctors/dtors management is explicitly turned off

Miscellaneous
LOAD_HIDDEN_MODULE (not default)
Load the module but make it invisible to WTX_MSG_MODULE_LIST

The Set Defaults buttons resets the options to their defaults.


*      
WARNING: The first time you start Tornado, you must open the Tools>Options>Download tab and set the defaults. Otherwise you may receive unexpected results.

Find dialog boxSee Help>Manuals Contents>Tornado API Reference>WTX Protocol>
WTX>WTX_OBJ_MODULE_LOAD for more information about these options.

12.3.2   Editor Preferences

Select Options in the Tools menu, then click the Editor tab to adapt the editor to your preferences. The Editor page is shown in Figure 12-2.

Figure 12-2:   Editor Page

The following choices are available on the Editor page:

Window Settings


Tab Size

Maximum Undo Levels

Save Options



File Format

12.3.3   External Editor

If you are accustomed to another editor, you may want to use Tornado only as a viewer and to provide debugging context, and pass control to your preferred editor when you want to make changes to a file. Select Options in the Tools menu, then click External Editor to specify an editor other than the Tornado editor. The External Editor page is shown in Figure 12-3.

Figure 12-3:   External Editor Page

The following choices are available on the External Editor page:

Settings


Invoke from

12.3.4   Project

Select Options in the Tools menu, then click Projects to specify certain project attributes. The Projects page is shown in Figure 12-4.

Figure 12-4:   Projects Page

The following choices are available on the Projects page:

Enable extended Build Options

Component Properties

Build Environment Variables

For example, using Tornado 1.0.1-style Build menu customizations, you can add a command that compiles the default make target in the same directory as the file currently open or selected in the Project tool. Use the $filepath macro in Working Directory and leaving Build Target blank in the Customize Builds dialog box.

Figure 12-5:   Customize Builds Example: Current Default

  

12.3.5   Version Control

If your organization uses a source-control (sometimes called configuration management) system to manage changes to source code, you probably need to execute a command to "check out" a file before you can make changes to it. Select Options in the Tools menu, then click Version Control to create commands to automatically check out or check in an open file using your version control system. The Version Control page is shown in Figure 12-6.

Figure 12-6:   Version Control Page

The following choices are available on the Version Control page:

Checkin

Checkout

Table 12-1:   Macros for Version Control


Menu Entry
Macro
Description
Example

File name
$filename
Name of the active file, without path information.
zap.c
Comment
$comment
Prompt for a checkin or checkout comment; any parameter needed by the tool can also be entered.

  

Figure 12-7:   Modify Comment Window


Defaults

Advanced

Commands created with the Checkin and Checkout text boxes appear on the pop-up menu accessed by right-clicking on the source file in the Tornado Editor window or the Project window.


*      
NOTE: If you use Visual SourceSafe as your version control system, you must also have "Assume project based on working folder" checked in SourceSafe. This is not the default, but it affects only command-line SourceSafe use. Go to SourceSafe Explorer, Tools->Options->Command Line Options, check this option, and exit SourceSafe Explorer: the change does not take effect until you exit SourceSafe Explorer.

12.3.6   Fonts/Colors

Select Options in the Tools menu, then click Fonts/Colors to change the fonts and colors that Tornado uses for all text windows: the editor window, the shell, and the debugger command window. The Fonts/Colors page is shown in Figure 12-8.

Figure 12-8:   Fonts/Colors Page

The Font selection boxes allow you to select a typeface, weight, and size in points. Different fonts are appropriate for different working environments: for example, usually a smaller point size is more desirable on a lap-top than on a large desktop display. The Sample box shows you what your selections will look like.

If you check the Syntax Coloring box, Tornado will identify various distinguished window elements by color, including syntactically distinguished text and the attribute-panel markers that appear during debugging.

You can choose which window element to color by clicking an entry in the Items list box. Table 12-2 describes the window elements available for coloring. The Foreground Color and Background Color panels allow you to control the foreground and background independently for each window element; click on the desired color in either list to assign that color to the currently selected window element.

Table 12-2:   Window Elements for Coloring  


Color Preferences Item
Description

Source Text (Default)
Editor-window color for text not otherwise highlighted.
Breakpoint Line
Breakpoint-symbol (or line, if no attribute pane) highlighting.
Comment
Editor window color for C or C++ comments.
Disassembly Line
Disassembly lines in editor window; entire disassembly window.
C Keyword
Editor-window color for C-language keywords.
C++ Keyword
Editor-window color for C++ keywords that are not C keywords.
Number
Integer literals in the editor window.
Floating Point
Floating-point numeric literals in the editor window.
String
String literals in the editor window.
Identifier
Symbolic names in source code (editor window).
Inspect Window
Window displayed by Inspect in Debug menu.
Build Output
Window for output from Project menu commands.
Registers Window
Window displayed by Registers in Debug menu.
Locals Window
Window displayed by Locals in Debug menu.
Text Selection
Current selection in any Tornado window.
Current Line
Context pointer (or line, if no attribute pane) highlighting.
Memory Window
Window displayed by Memory in Debug menu.
Backtrace Window
Window displayed by Back Trace in Debug menu.
Debugger
Debugger command window.
Shell
Tornado shell (WindSh) window.
Previous Context
Context pointer, while viewing non-current stack level.
Registers Highlight
Highlighting for updates to Registers window.
Locals Highlight
Highlighting for updates to Locals window.
Inspect Highlight
Highlighting for updates to Inspect window.
Backtrace Highlight
Highlighting for updates to Backtrace window.
Current Error/Tag
Selected error line in editor, when navigating from build output.
Component Error
Highlighting for components and their parents that are in error in the VxWorks view of the Workspace window.
Component Highlight
Highlighting for components and their parents that are selected in the VxWorks view of the Workspace window during Auto Scale or Component Find processes.
Component Normal
Text color for normal components in the VxWorks view of the Workspace window (neither errors nor selected).

You can always return to the original settings by clicking the following buttons:

Restore to Default

Restore All Defaults

12.3.7   Debugger

Select Options in the Tools menu, then click Debugger to customize various debugger attributes. The Debugger page is shown in Figure 12-9.

Figure 12-9:   Debugger Page

The following choices are available on the Debugger page:

General


Memory Window


Auto attach to tasks

  • Never: the debugger never automatically attaches to the task throwing the exception.
  • Only if not already attached: The debugger attaches to the task if you are not already attached to another task.
  • Always: the debugger always automatically attaches to the task throwing the exception.

12.3.8   Tornado Registry

Select Options in the Tools menu, then click Tornado Registry to change the Tornado registry. The Tornado Registry page is shown in Figure 12-10.

Figure 12-10:   Tornado Registry Page

A local registry resides on your local host. It lists any target servers you have running on your host. If others are using your machine as a remote registry, their target servers will also appear on the list; otherwise only your local target servers are known to Tornado.

A remote registry resides on another host. All your target servers and any other networked target servers known to that registry are listed. You can specify either the host name or the IP address of the remote host.

12.3.9   Installation and Licenses

Press one of the buttons to launch the Tornado SETUP program. You can change the following settings that you specified from Setup when you installed Tornado:

  • Reconfigure Registry

  • Register File Types

  • Reconfigure Licensing



12.4    Customizing the Tools Menu

You can add entries to the Tools menu to allow easy access to additional tools. Before you add any commands in this part of the menu, Tornado displays the placeholder No Custom Tools as a disabled menu entry. The Customize command in the Tools menu allows you to add (or remove) entries at the end of the Tools menu.

12.4.1   The Customize Tools Dialog Box

Click Customize in the Tools menu to open the Customize Tools dialog box (Figure 12-11).

Figure 12-11:   Customize Tools Dialog Box

The Menu Contents list box in the Customize Tools dialog box shows all custom commands currently in the Tools menu. When you select any item in this list, you can edit its attributes in the three text boxes near the bottom of the dialog box.

The Customize Tools dialog box has the following buttons:

Add

Remove

Move Up

Move Down

OK

Cancel

The three text boxes near the bottom of the Customize Tools dialog box allow you to specify or change the attributes of a custom command.

Menu Text

Tool Command

Working Directory

At the bottom of the Customize Tools dialog box are the following check boxes:

  • Prompt for Arguments

When this box is checked, Tornado prompts for command arguments using a dialog box, when you click the new command. The command line is displayed in a window where you can add additional information. (See Figure 12-12.)

Figure 12-12:   Command Line Arguments Dialog Box

  • Redirect to Child Window

When this box is checked, Tornado redirects the output of your command to a child window--a window contained within the Tornado application window. Otherwise, the command runs independently, either as a console application or a Windows application.

  • Close Window On Exit

When this box is checked, Tornado closes the window associated with your tool when the command is done. This only applies when you also check the Redirect to Child Window box to redirect command output to a child window.

Macros for Customized Menu Commands

The pop-up menu opened by the buttons to the right of the text boxes provides several macros for your use in custom menu commands. These macros allow you to write custom commands that are sensitive to the context in the editor, or to the global Tornado context. For example, there are macros for the full path of the file in the active editor window, and for useful fragments of that file's name. Table 12-3 lists macros for editor context; in this table, the phrase active file refers to the file that is open in the active editor window (or selected in the project facility if no editor window is open).

Table 12-3:   Menu-Customization Macros for Editor Context


Menu Entry
Macro
Description
Example

File path
$filepath
Full path to the active file.
c:\tornado\zap.c
Dir name
$filedir
Directory containing the active file.
c:\tornado
File name
$filename
Name of the active file, without path information.
zap.c
Base name
$basename
Name of the active file, without the file extension.
zap
Line number
$line
The line number where the cursor is positioned in the active file.
15
Column number
$column
The column number where the cursor is positioned in the active file.
25
Selected text
$textsel
The current selection (highlighted text) in the active file.
hitCount(void)

Table 12-4 lists macros for the project facility context.

Table 12-4:   Menu-Customization Macros for Project Context


Menu Entry
Macro
Description
Example

Project dir
$projdir
The name of the directory of the current project.
c:\proj\widget
Project build dir
$builddir
The name of the directory for the current build of the current project.
c:\proj\widget\default
Derived object
$derivedobj
The name of the derived object of the currently selected source file in the current project.
c:\proj\widget\default\zap.o

Table 12-5 lists macros for the global Tornado context.

Table 12-5:   Menu-Customization Macros for Global Context


Menu Entry
Macro
Description
Example

Target name
$targetName
The full name of the target server selected in the Tornado Launch toolbar.
vxsim@ontario
Target
$target
The name of the target selected in the Tornado Launch toolbar.
vxsim
Tornado inst. dir
$wind_base
Installation directory recorded in the environment variable WIND_BASE.
c:\tornado
Tornado host type
$wind_host_type
Host type recorded in the environment variable WIND_HOST_TYPE.
x86-win32
Tornado registry
$wind_registry
Registry recorded in the environment variable WIND_REGISTRY
mars

These macros are available for custom entries in the Build menu as well as for the Tools menu. For information on making them available though the Build menu, see 12.3.4 Project. For information on using them for custom builds, see 12.4.3 Customizing the Build Menu.

12.4.2   Examples of Tools Menu Customization

Version Control

This example illustrates how to use the Customize Tools dialog box to add an Uncheckout command to the Tools menu: the command cancels the checkout of whatever file is currently open in Tornado (that is, the file visible in the current editor window). Figure 12-13 illustrates the specification for a ClearCase command to uncheckout a module.

Figure 12-13:   Uncheckout Command for Tools Menu

The Menu Text entry indicates that the command unchecks out a file, but is not specific to any particular file. The Tool Command field uses the $filepath macro (Macros for Customized Menu Commands) to expand the current file to its full path name.

In this example, the Prompt for Arguments box is checked. When the new Uncheckout command in the Tools menu is executed, the predefined argument list appears as a default in a dialog box (shown in Figure 12-14), to permit specifying other arguments if necessary.

Figure 12-14:   Prompt for Arguments Dialog Box

Alternate Editor

Figure 12-15 illustrates the specification for a command to run the Windows Notepad editor on the file that is currently open in Tornado. The Menu Text contains a useful name, while the Tool Command field uses the actual execution command and $filepath to identify the current file. In this case, Prompt for Arguments is not checked; thus the editor runs immediately.

Figure 12-15:   Custom Editor Command for Tools Menu

Normally you would change the default editor to an external editor using the External Editor tab under Tools>Options. In the case where you only wish to use an alternate editor some of the time, you may prefer this method.

Binary Utilities

Tornado includes a suite of software-development utilities described in the GNU ToolKit User's Guide: The GNU Binary Utilities. If you execute any of these utilities frequently, it may be convenient to define commands in the Tools menu for that purpose.

Figure 12-16 illustrates the specification for a command to run the sizearch utility, which lists the size of each section of an object module for target architecture arch. In this case, the Tool Command field uses $filedir/SIMNTgnu/$basename to construct the path and name of the object file generated from the current source file The Working Directory field is filled in using the browse option to locate the appropriate version of sizearch in the correct directory.

Figure 12-16:   Object-Module Size Command for Tools Menu

World Wide Web

You can add a Tools command to link your Web browser directly to announcements from Wind River (and to related Internet resources). Figure 12-17 shows the specification for a Wind River Web Page command. (For a description of the information available on the Wind River home page, see 1.6 Customer Services.

Figure 12-17:   Web Browser Command for Tools Menu

Tornado itself does not include a Web browser. If you do not have a Web browser, or your system does not have direct Internet access, ignore this example; it provides convenient access to information, but no essential functionality.

12.4.3   Customizing the Build Menu

If you are using Tornado 1.0.1 build techniques, you can add commands to the Build menu to build any object that can be generated using make. Typically this requires first generating (or writing) a makefile that specifies the rules to build that object. It also requires checking Show Tornado 1.0.1 menu items on the Project tab of the Tools>Options menu (see 12.3.4 Project).

Once a makefile is in place, click Customize in the Build menu to add your own commands to the bottom part of that menu (or to remove commands you no longer need). The Customize Builds dialog box appears (Figure 12-18). This dialog box shows all custom entries already present in the Project menu (if any), and allows you to add commands to, remove commands from, or reorder the list of custom Project commands.

Figure 12-18:   Dialog Box: Customize Builds

The Customize Builds dialog box has the following buttons:

Add

Remove

Move Up

Move Down

OK

Cancel

The Menu Contents list box in Customize Builds shows all custom commands currently in the Build menu. When you select any item in this list, you can edit its attributes in the three text boxes near the bottom of the dialog box:

Menu Text

Build Target


Working Directory




12.5    Tcl Customization Files

When Tornado begins executing, it checks for initialization files of the form .wind\filename.tcl in two places: first under c:\tornado (that is, in the directory specified by the WIND_BASE environment variable), and then in the directory specified by the HOME environment variable (if that environment variable is defined). If any files are found, their contents are sourced as Tcl code when Tornado starts.

Tornado Initialization

The Tornado.tcl file allows you to customize the Tools menu and tool bar, as well as other elements of the Tornado window. For example, you can have your own dialog box appear based on a menu item you add to any menu. For more information about the Tcl customization facilities available, see the Tornado API Programmer's Guide or the online Tornado API Reference.

HTML Help Initialization

The windHelp.tcl file allows you to specify a different HTML browser. The default is NetScape Communicator. To change the default, create windHelp.tcl with the following contents:

set htmlBrowser "newbrowser -install"