• Keine Ergebnisse gefunden

Options menu

Im Dokument PR FILER " (Seite 130-136)

Macros ~

DfsplQY options •••

Path for source •••

Save opt1ons •••

Restore options •••

Macros

Create... Alt a

Stop recording Alt-Remove

Delete all

With the Options menu, you can .. record a menu-command macro

II remove one or all menu-command macros

III set display options that control Turbo Profiler's overall appearance and operation

• specify directories (other than the current one) where Turbo Profiler will search for source code

£I save your window layout, macros, options set in other menus, and some other miscellaneous options to a configuration file

D restore the settings and options previously saved in a configuration file

The Options I Macro command leads to another menu, shown here.

With the commands on this Macro menu, you can define new macros or delete ones you've already assigned to a key. Mouse actions are not included in a macro.

To begin a macro recording session, 1. Choose Options I Macro I Create.

A prompt asks for which key to assign the macro to. Type in a keystroke or combination of keys (for example, Alt-W. The message RECORDING appears in the upper right corner of the screen while you record the macro.

2. Type the keystrokes you want to record. The profiler responds normally to these keystrokes and mouse actions, as if you weren't recording a macro.

When you finish recording keystrokes, choose Options I Macros I Stop Recording (or press the key you assigned the macro to-Alt-M in this example) to stop the recording session.

How macro recording and playback works

With the profiler's macro recording facility, you can record your frequently used keystroke sequences. During profiling, for example, you often repeat the same sequence of commands to get to a certain place in your program. This can be very tedious.

Chapter 4. The Turbo Profiler environment 121

122

But, with Options I Macro, you can define a macro that records all the keys you press from the moment you first start the pro filer until you have your program in the desired state. At that point, you can stop recording. If you must get back to the same place in your program, simply replay the macro.

You can't use Options I Macro to record keystrokes that must be typed as input to your program. You can only record Turbo Profiler commands.

To record your entire profiling session, 1. Start Turbo Pro filer from DOS.

2. Choose Options I Macros I Create (or press Alt=) to define the macro. A prompt appears, asking which key you want the macro assigned to.

3. Choose a key that hasn't been assigned to a routine yet, such as Shift and a routine key (Shift-F10, for example).

4. Load your program. Turbo Pro filer will automatically restore area settings from your program's. TF A file.

5. If you want to use a configuration different from the default, load the appropriate config file (choose Options I Restore).

6. Run your program: Stop execution if necessary.

7. Stop recording the macro: Choose Options I Macros I Stop Recording (or press A1t-).

8. Save the macro to a configuration file: Choose Options I Save Options, choose Macros in the Save Configuration dialog box, type the name of the corresponding configuration file (if you don't want to use the one listed in the dialog box), then choose OK or press Enter.

9. Continue running your program.

If your program requires you to type things to get to the next part of the recorded command sequence, you still must enter those keystrokes manually (you can do this while the macro is running).

For programs that don't require any input, this command-recording mechanism can completely automate the restart procedure, saving many keystrokes.

When you save a macro to a configuration file, the profiler saves the total environment configuration, including opened and zoomed windows. So, if you record a macro that opens a window, and you don't close the window before saving the macro, the next

Turbo Pro filer User's GuIde

time you restore that configuration file, the window opens automatically-even if you don't execute the macro.

Create (Alt=)

The Create command starts recording keystrokes that you want assigned to a macro key. Alt= is the hot key for Create.

Stop Recording (Alt-)

The Stop Recording command stops recording the keystrokes you're assigning to a macro key. Use this command after choosing Options I Macros I Create. Alt-is the hot key for Stop recording.

Remove

The Remove command removes a macro assigned to a single key.

A prompt asks you to press the key of the macro you want removed.

Delete

The Delete command removes all keystroke macro definitions and restores all keys to their original (default) meanings.

Display Options The Options I Display Options command opens the Display Options dialog box, shown here.

Figure 4.37 The Display Options dialog box

With the Display Options dialog box, you can do any of the following:

• specify whether Turbo Pro filer will swap screens while your program runs

• set how many columns each tab stop occupies in the Module window

• set the Turbo Pro filer screen to 25-line or 43/50-line mode

Chapter 4, The Turbo Pro filer environment 123

124

• specify how wide your program's routine names display in the Execution Profile and Areas windows.

Display Swapping

The Display Swapping radio buttons provide two options for how Turbo Pro filer swaps the User screen back and forth with the Turbo Profiler environment: None, and Always.

• None means don't swap between the two screens.

Use this option if you're profiling a program that does not send any output to the User Screen.

• Always means swap to the User Screen every time your pro-gram runs.

Use this option if your program does writing to the screen.

Screen Lines

You use Screen Lines to specify whether Turbo Profiler's screen uses the normal 25-line display or the 43- or 50-line display available on EGA and VGA display adapters.

One or both of these buttons will be available, depending on the type of video adapter in your PC. The 25-line mode is the only screen size available to systems with a monochrome display or Color Graphics Adapter (eGA).

Tab Size

With the Tab Size input box, you set how many columns each tab stop occupies, from 1 to 32 columns. You can reduce the tab column width to see more text in source files with a lot of tab-indented code.

Width of Names

The Width of Names input box is where you specify how wide routine names display in the Execution Profile, Callers, and Areas windows.

Turbo Pro filer User's GuIde

Path for Source By default, Turbo Profiler looks for your program's source code in these places, in this order:

1. In the directory where the original compiler found the source files

2. In the current directory

3. In the directory that contains the program you're profiling With the Options I Path for Source command, you can add a list of directories that Turbo Pro filer searches before it searches in the curren t directory.

Enter the new to-be-searched directories in this format:

Directory; Directory; Directory For example,

C:\Borland\TC; C:\Borland\TASM

Save Options With Options I Save Options, you can save all your current

Figure 4.38 The Save Configuration dialog box

pro filer options to a configuration file on disk. Then, whenever you want to reset the pro filer options to those saved settings, you can load that configuration file with Options I Restore Options.

When you choose Options I Save Options, the following Save Configuration dialog box comes up:

With this dialog box, you can save your current pro filer setup's options, layout, and macros. Options, Layout, and Macros are check boxes; you can save one, two, or all three types of information to a configuration file.

11 Options are menu options not saved in a .TFA or .TFS file (such as Options I Path for Source, command-line options, and settings in the Display Options dialog box).

II Layout includes which windows are currently open, plus their order, position, and size.

Chapter 4, The Turbo Profiler environment 125

126

• Macros are all keystroke macros currently defined.

• Save To lists the default configuration file, TFCONFIG.TF. To save your options there, choose OK (or press Enter).

To save them to a different file, type in the different file's name (including disk drive and path, if you want), then choose OK (or press Enter).

Once you've saved options to a configuration file, you can recover them at any time with Options I Restore.

Restore Options I Restore restores your profiling options from a disk file.

Figure 4.39 The Restore dialog box

You can have multiple configuration files, containing different macros, window layouts, and so on.

When you choose Options I Restore, this dialog box comes up:

The Restore dialog box works just like the profiler's other file-loading dialog boxes. You can

• enter a file name or a specification (with DOS wildcards) in the File name input box

• choose a different disk drive or directory from the directory tree

• choose a file name from the Files list box

• choose OK to complete the transaction (or choose Cancel to leave the dialog box without loading a file)

• choose Help to open a window of information about how to use the dialog box

After you type in or choose a configuration file name and load that file, Turbo Pro filer restores all the saved options, settings, layout, and macros to the current Turbo Profiler environment.

Turbo Pro filer User's Guide

(You can only restore a configuration file that was created by the Options I Save Options command.)

Im Dokument PR FILER " (Seite 130-136)