After you enabled the debugger in the ColdFusion Administrator and configure Eclipse, you can debug ColdFusion pages that are in an Eclipse project. You can use the ColdFusion Debugger to do the following tasks:
Begin debugging a ColdFusion application
You can set breakpoints in your CFML file to stop execution of the page at particular points. When you set a breakpoint on a line, execution of the CFML stops just before that line. For example, if you set a breakpoint on the third line in the following CFML page, execution stops before <cfset myName = "Wilson">.
<cfset yourName = "Tuckerman"> <cfoutput>Your name is #yourName#.</cfoutput> <cfset myName = "Wilson"
You should execute the page that you want to debug before setting any breakpoints to compile it before debugging it. This improves performance during debugging. You cannot set a breakpoint in a file that is not part of a project.
Also, you can view a list of breakpoints set in the current Eclipse project in the Breakpoints panel.
ColdFusion breakpoints have four states in the Eclipse debugger:
For performance reasons, ColdFusion does not try to resolve unresolved breakpoints every time you execute the page. It tries to resolve them when you modify the page and execute it. If you think that the line at which ColdFusion shows an unresolved breakpoint is valid, delete the breakpoint and set it again.
You can use the Step Into, Step Over, and Step Return buttons to proceed through your CFML application line by line. Use Step Into to proceed into included files, such as UDFs or CFCs. Use the Step Over button to proceed through your CFML application, bypassing included files, such as UDFs or CFCs. Use the Step Return button to return to the original page from which you entered the included file, such as UDFs or CFCs.
For the stepping process to work properly, you must clear the cache of compiled classes. To do so, recompile all CFML pages compiled with an earlier version of ColdFusion. In large files, you might find that stepping and breakpoints are slow. To improve performance, in Eclipse, select Windows > Preferences > ColdFusion > Debug Settings and deselect all scopes for which you do not require information.
You should avoid using Step In on CFML instructions such as the cfset tag. Step In is more performance intensive than Step Over. You can use Step In for UDFs, CFCs, custom tags and included files.
When stepping into functions, tags, and files, Eclipse expects the file to be displayed in one of the open projects. The file that you are stepping in must be in an open Eclipse project.
Sometimes Eclipse 3.2.1 does not show the stack trace, and step buttons are disabled, even though the debugger has stopped at a line. To enable the step buttons, click the debugger server instance in the Debug window. To see the stack trace, click either Step In or Step Out.
As you observe execution of your code, you can see the values and scope of variables in the Variables panel. The Variables panel displays the scope and value of variables as the CFML code executes. Only variables whose scopes are those you selected in the Preferences dialog box appear in the Variables pane.