Eventpoints. freescale IDE 5.7
Annonce
Annonce
Manipulating Program Execution
Eventpoints
Specifying the Default Breakpoint Template
Use the Templates page of the Breakpoints window to specify the default breakpoint template. The debugger uses this template as the basis for creating new breakpoints in your source code.
The initial default breakpoint template is Auto Breakpoint, which defines the regular breakpoint. You can specify any one of your breakpoint templates, or Auto Breakpoint, as the default breakpoint template.
To specify the default breakpoint template, follow these steps:
1. Click View > Breakpoints or Window > Breakpoints Window.
The Breakpoints window appears.
2. Click the Templates tab of the Breakpoints window.
3. Select the breakpoint template that you want to specify as the default breakpoint template.
4. Click Breakpoints > Set Default Breakpoint Template or click the Set Default
Breakpoint Template icon in the Breakpoints window toolbar.
The debugger now uses the breakpoint template that you specified as the basis for creating new breakpoints in your source code.
Eventpoints
You use eventpoints to perform a task when program execution arrives at a specific line of source code or when an associated conditional expression evaluates to true. You can set an eventpoint that performs a task such as running a script, playing a sound, or collecting trace data. An eventpoint is equivalent to a breakpoint that performs a task other than halting program execution.
You can use several kinds of eventpoints. The Breakpoints column represents these eventpoints with various icons. You can set more than one eventpoint on the same line of source code. The Breakpoints column shows all eventpoints that you set for each line.
explains the eventpoints and shows their corresponding icons.
214 IDE 5.7 User’s Guide
Manipulating Program Execution
Eventpoints
Table 18.4 Eventpoints
Eventpoint
Icon Explanation
Logs or speaks a string or expression and records messages to the Log window
Pauses execution long enough to refresh debugger data
Runs a script, application, or other item
Skips execution of a line of source code
Plays a sound
Stops collecting trace data for the Trace window
Starts collecting trace data for the Trace window
You can also create breakpoint templates to simplify the process of setting complex eventpoints. Creating a breakpoint template for an eventpoint is nearly identical to creating a breakpoint template for a breakpoint. The difference is using an eventpoint instead of a breakpoint as the starting point for creating the breakpoint template.
Eventpoints have enabled and disabled states.
explains these states.
Table 18.5 Eventpoint States
State Icon
Enabled See
Disabled
Explanation
Indicates that the eventpoint is currently enabled. The debugger performs the specified task at an enabled eventpoint. Click the icon to disable the eventpoint.
Indicates that the eventpoint is currently disabled. The debugger does not perform the specified task at a disabled eventpoint. Click the icon to enable the eventpoint.
IDE 5.7 User’s Guide 215
Manipulating Program Execution
Eventpoints
TIP
You can set an eventpoint in the Thread window and for selected variables in the
Symbolics window.
Log Point
A Log Point logs or speaks a string or expression. A Log Point can also record messages to the Log window. You can configure the message that appears in the log window.
Setting a Log Point
To set a Log Point, follow these steps:
1. Click the cursor on the line of source code at which you want to set the Log Point.
2. Click Debug > Set Eventpoint > Set Log Point.
The Log Point Settings window (
Figure 18.3 Log Point Settings Window
216
3. Enter the text of your log message in the Message text box.
4. Check at least one of these checkboxes:
• Log Message—check to have the IDE display your message in a Message window when program execution reaches the Log Point
• Speak Message (Windows OS)—check to have the IDE use the sound capabilities of the host operating system to speak the message that you enter in the Message text box.
IDE 5.7 User’s Guide
Manipulating Program Execution
Eventpoints
NOTE
(Windows) Install the Speech software development kit (SDK) in order to have the Speak Message feature work correctly.
• Treat as Expression—check to have the IDE evaluate the text you enter in the
Message text box as an expression. For example, if you enter the name of a variable in the Message text, the debugger writes the value of that variable in the console output window.
• Stop in Debugger—check to stop program execution in the debugger
5. Click the OK button to confirm your settings.
Example use: If you want to display the value of a variable each time some code is executed, set a log point, check the Log Message and Treat as expression boxes and enter the variable name in the edit box, then click OK.
Clearing a Log Point
To clear a Log Point, follow these steps:
1. Select the Log Point that you want to clear.
Click the cursor on the line of source code that has the Log Point, or select the Log
Point by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Log Point.
Pause Point
A Pause Point suspends program execution long enough to refresh debugger data. For example, without setting a pause point, you must wait for the debugger to halt program execution before it can refresh data. Setting a Pause Point, however, lets you pause the debugging session to give the debugger time to refresh the data.
Setting a Pause Point
To set a Pause Point, follow these steps:
1. Click the cursor on the line of source code at which you want to set the
Pause Point.
2. Click Debug > Set Eventpoint > Set Pause Point.
IDE 5.7 User’s Guide 217
Manipulating Program Execution
Eventpoints
Clearing a Pause Point
To clear a Pause Point, follow these steps:
1. Select the Pause Point that you want to clear.
Click the cursor on the line of source code that has the Pause Point, or select the Pause
Point by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Pause Point.
Script Point
A Script Point runs a script, application, or other item. After you set a Script Point at a line of source code, its associated action occurs when program execution arrives at that line.
For example, you can set a Script Point that performs these actions:
• (Windows) execute a file as if you had used a Windows command line
• (Mac OS) launch an AppleScript or application
Setting a Script Point
To set a Script Point, follow these steps:
1. Click the cursor on the line of source code at which you want to set the
Script Point.
2. Click Debug > Set Eventpoint > Set Script Point.
The Script Point Settings window(
) appears.
Figure 18.4 Script Point Settings Window
218 IDE 5.7 User’s Guide
Manipulating Program Execution
Eventpoints
3. Use the list box to specify Commands or Script File.
Specify Commands (Windows) if you intend to enter a command line that executes a file. Specify Script File if you intend to enter a path to a script file.
4. Enter the text of your Script Point in the text box.
Enter a command line or a path to a script file.
5. Check Stop in Debugger if you want to stop program execution in the debugger.
6. Click the OK button to confirm your settings.
Clearing a Script Point
To clear a Script Point, follow these steps:
1. Select the Script Point that you want to clear.
Click the cursor on the line of source code that has the Script Point, or select the Script
Point by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Script Point.
Skip Point
A Skip Point prevents the debugger from executing a line of source code. This eventpoint is useful when you are aware of a line that you need to fix, but would like to go ahead and debug the rest of the program. You can set a Skip Point at that line and have the debugger execute the rest of the project without executing that particular line.
NOTE
Skip Points do not work with the Java programming language.
Setting a Skip Point
To set a Skip Point, follow these steps:
1. Click the cursor on the line of source code at which you want to set the Skip Point.
2. Click Debug > Set Eventpoint > Set Skip Point.
Clearing a Skip Point
To clear a Skip Point, follow these steps:
IDE 5.7 User’s Guide 219
Manipulating Program Execution
Eventpoints
1. Select the Skip Point that you want to clear.
Click the cursor on the line of source code that has the Skip Point, or select the Skip
Point by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Skip Point.
Sound Point (Windows OS)
A Sound Point is an audible alert. You can set a Sound Point so that when you step or run through code, the IDE plays a sound when program execution arrives at the line that has a
Sound Point. Unlike a Log Point set to Speak Message, which speaks the message you specify, the Sound Point plays a simple notification sound.
Setting a Sound Point
To set a Sound Point, follow these steps:
1. Click the cursor on the line of source code at which you want to set the
Sound Point.
2. Click Debug > Set Eventpoint > Set Sound Point.
The Sound Point Settings window (
Figure 18.5 Sound Point Settings Window
220
3. Use the Sound to Play list box to specify the notification sound that you want the IDE to play when program execution arrives at the Sound Point.
4. Check Stop in Debugger if you want to stop program execution in the debugger.
5. Click the OK button to confirm your settings.
IDE 5.7 User’s Guide
Manipulating Program Execution
Eventpoints
Clearing a Sound Point
To clear a Sound Point, follow these steps:
1. Select the Sound Point that you want to clear.
Click the cursor on the line of source code that has the Sound Point, or select the
Sound Point by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Sound Point.
Trace Collection Off
A Trace Collection Off eventpoint stops the collection of trace data. This eventpoint is useful when you want trace collection to stop when program execution reaches a line of source code that you specify.
Setting a Trace Collection Off Eventpoint
To set a Trace Collection Off eventpoint, follow these steps:
1. Click the cursor on the line of source code at which you want to set the
Trace Collection Off eventpoint.
2. Click Debug > Set Eventpoint > Set Trace Collection Off.
Clearing a Trace Collection Off Eventpoint
To clear a Trace Collection Off eventpoint, follow these steps:
1. Select the Trace Collection Off eventpoint that you want to clear.
Click the cursor on the line of source code that has the Trace Collection Off eventpoint, or select the Trace Collection Off eventpoint by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Trace Collection Off.
Trace Collection On
A Trace Collection On eventpoint starts the collection of trace data. This eventpoint is useful when you want trace collection to start when program execution reaches a line of source code that you specify.
IDE 5.7 User’s Guide 221
Manipulating Program Execution
Eventpoints
222
Setting a Trace Collection On Eventpoint
To set a Trace Collection On eventpoint, follow these steps:
1. Click the cursor on the line of source code at which you want to set the
Trace Collection On eventpoint.
2. Click Debug > Set Eventpoint > Set Trace Collection On.
Clearing a Trace Collection On Eventpoint
To clear a Trace Collection On eventpoint, follow these steps:
1. Select the Trace Collection On eventpoint that you want to clear.
Click the cursor on the line of source code that has the Trace Collection On eventpoint, or select the Trace Collection On eventpoint by name in the Breakpoints window.
2. Click Debug > Clear Eventpoint > Clear Trace Collection On.
Working with Eventpoints
This section explains how to work with eventpoints in your source code and in the
Breakpoints window.
Viewing Eventpoint Properties
After you set an eventpoint, you can view and modify its properties.
To view properties for an eventpoint, select its name in the Breakpoints window and click
Breakpoints > Breakpoint Properties.
Disabling an Eventpoint
Disable an eventpoint to prevent it from performing its specified action. The disabled eventpoint remains at the source-code line at which you set it, so that you can enable it later. Disabling the eventpoint is easier than clearing it and re-creating it from scratch.
To disable an eventpoint, follow these steps:
1. Select the eventpoint that you want to disable.
Select the eventpoint by name in the Breakpoints window, or click the cursor on the source-code line that contains the eventpoint.
IDE 5.7 User’s Guide
Manipulating Program Execution
Eventpoints
2. Click Debug > Disable Eventpoint.
The Disable Eventpoint menu appears.
3. From the menu, click the Disable Eventpoint command, where Eventpoint is the type of eventpoint that you want to disable.
The enabled eventpoint icon changes to a disabled eventpoint icon (shown at left).
The disabled eventpoint icon indicates that the eventpoint does not perform its specified action.
Enabling an Eventpoint
Enable an eventpoint to have it perform its specified action during program execution.
Enabling an eventpoint that you previously disabled is easier than clearing it and recreating it from scratch.
To enable an eventpoint, follow these steps:
1. Select the eventpoint that you want to enable.
Select the eventpoint by name in the Breakpoints window, or click the cursor on the source-code line that contains the eventpoint.
2. Click Debug > Enable Eventpoint.
The Enable Eventpoint menu appears.
3. From the menu, click the Enable Eventpoint command, where Eventpoint is the type of eventpoint that you want to enable.
The disabled eventpoint icon changes to its original eventpoint icon ( Table 18.4
). The enabled eventpoint icon indicates that the eventpoint will perform its specified action.
Setting a Conditional Eventpoint
Use the Condition column of the Breakpoints window to set a conditional eventpoint. A
conditional eventpoint has an associated conditional expression.
The debugger evaluates the expression to determine whether the eventpoint performs its specified action.
A conditional eventpoint behaves in two different ways:
• If the expression evaluates to true (a non-zero value), the eventpoint performs its specified action.
• If the expression evaluates to false (a zero value), the eventpoint does not perform its specified action.
Follow these steps to set a conditional eventpoint:
IDE 5.7 User’s Guide 223
Download
Annonce