![]() ![]() ![]() |
Running the debugger helps you find problems in code by tracing the way ColdFusion evaluates the page, step by step. You do this by placing breakpoints in the page to stop execution of the page, and then step through subsequent lines of code, checking the values of variables and expressions to make sure the code is behaving as you'd expect.
After you've set up remote development settings and file mappings, you can use the commands on the Debug menu and the Debug toolbar to run the debugger.
See Chapter 3, ColdFusion Studio Quick Start for a list of keyboard shortcuts for the debugger.
You cannot debug encrypted templates.
The Debug toolbar appears at the bottom of the application window. You can undock the toolbar by double-clicking on the undock bars on the left-hand side of the toolbar, drop it into the Quick Bar, or keep it docked.
The breakpoint lines are colored red. Choose Debug > Toggle Breakpoints to turn breakpoints on and off. Use the Debug > Clear Breakpoints to delete all breakpoints in the current document.
The Remote Development Settings dialog box appears. It shows the default local server.
Enter a fully qualified file path relative to your local ColdFusion server -- for example, http://127.0.0.1/SomeServerPath/index.cfm.
The Debug Start dialog box displays every time you press the Start button in the Debugger. Use the check box on the Debug Start pane to disable the display of this box the next time you hit the RUN button.
Whenever possible, ColdFusion Studio tries to calculate the URLs of open file using the RDS development mappings, which you can set in the Mappings tab. These mappings are also required to develop on remote servers.
Based on the RDS Security settings at your site, you'll see a login prompt to access protected resources.
The debugger starts, and it forwards your URL to the Browse view. When the ColdFusion server encounters the breakpoint, a blue bar appears at the breakpoint in the Edit view. At this point, the ColdFusion server has an open session, and it waits for your reply from ColdFusion Studio.
The final time you hit the Start/Continue button, ColdFusion executes the page and outputs it to the browser.
The debugger is active until you hit the End button on the Debug toolbar or choose Debug > End. This allows you to debug across multiple pages.
Choose View > Debug Window to open the Debug window. There are several panes to this window:
Each of these windows has an associated command button on the Debug toolbar.
You can undock these windows individually, so you can see breakpoints while you're looking at the Watches, for example.
You can use the Step Into, Step Over, Step Out, and Run to Cursor tools on the Debug toolbar to step through your code.
If the next step is inside an included file or CFX, the debugger steps into the next file.
You can use the evaluator box at the top of the Watches pane of the Debug window to evaluate arbitrary expressions when the debugger is suspended at a breakpoint. Use the evaluator when you want to know how an expression evaluates as you step through code, line by line.
Watches allow you to evaluate the same expression or variable every time you stop execution. When you set a watch, the debugger evaluates the watched expression. A hand pops up when the expression's value changes from one line to the next as you step through code.
The Evaluator window shows the results of the evaluation at the current point in processing the page.
The Watch area shows the values of watched expressions and any error messages in resolving these parameters.
You can use the evaluator to change values of variables, create new variables, or practice using ColdFusion functions in your expressions.
The debugger is active even after a page is loaded, and until you press the End button on the Debug toolbar or choose Debug > End.
This enables you to debug applications across multiple HTML and CFML pages. For example, you can test the submission of an HTML form and its subsequent processing by a ColdFusion application page.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.