Using Macros
The Hardware Debugger allows you to define macros to automate tasks. After you have completed a procedure, you can capture the steps you want to include in your macro by selecting the commands from the Console window, copying them into a macro window, and saving the macro.
Alternatively you can type the commands directly in a macro window. For information about the available commands and their specific syntax, refer to the Console Commands appendix.
Creating a Macro
Follow these steps to create a macro.
- Select File
New
Macro.
A macro window appears, as shown in the New Macro Window figure.
- Select View
Console to invoke the Console window and view the commands that have been executed.
The Console window appears as shown in the Console Window figure.
- Click the left mouse button at the beginning of the first command that you want to copy. Holding down the Shift key, click the left mouse button at the end of the last command you want to copy.
- Copy the steps you want from the Console window by selecting Edit
Copy.
- Select the macro window.
- Paste the commands into the macro window by selecting Edit
Paste.
- Repeat steps 3 through 6 to copy non-consecutive lines into the macro.
- Use comments to note options and strategies, by preceding your comment text with the # character. Comments in a macro file always start with the # character on the line.
- Save the macro using the File
Save or click the following toolbar button.

Editing an Existing Macro
To edit an existing macro, follow these steps.
- Select File
Open
Macro from the menu and open the macro you want to modify from the list of macros in the Open Macro File dialog box.
- In the Macro window, select commands by double-clicking the left mouse button to select a word. You can also select an entire block of text by pressing the left mouse button, dragging the mouse to the end of the region you want to copy, and then releasing.
- Use the Cut, Copy, and Paste commands from the Edit menu to copy the selected information and paste it at the new insertion point.
- Select File
Save to save the change or click the following toolbar button.

Running a Macro
To run a macro, follow these steps.
- Open the macro by selecting File
Open
Macro.
- Select File
Run Macro or click the following toolbar button.

Saving the Console Log to a File
After invoking commands, you can check the command history for a debug session by opening the Console window. You can also save the command history, or command log, to a text file.
- Select the contents of the Console window by clicking on the left mouse button at the top of the window and dragging the cursor down to the end of the window.
To select the entire log, select the top part of the log, then click on the scroll bar to scroll down to the bottom of the page. At the bottom of the page, press the Shift key while you click the mouse button again to complete the selection.
- Select Edit
Copy to copy the selected contents of the Console window to the clipboard.
- Invoke a text editor, open a new file, and paste the contents of the clipboard into the file.
The contents of the Console window appear inside the file.
- Save the file using the appropriate text editor command.