The ColdFusion Debugging perspective ( invoked through Run > Debug Configuration > Perspectives) contains tools to debug your ColdFusion applications as well as client-side applications. There are different views that let you add breakpoints to your code, step into functions, step over functions, or examine and evaluate expressions in your code. The editor works with the debugging tools to locate and highlight lines of code that need correction.
A. Variables view B. Debug output buffer view C. Breakpoints view D. Expressions view E. Outline view F. Debug view G. Edit view H. Servers view I. Console view J. Problems view K. TailView view
The Debug view retains the results of each debug session. The Debug view shows the stack trace when the page execution is suspended at breakpoint or when stepping into or over code.
The Debug toolbar contains the following buttons (left to right):
|Resume||Resumes a debugging session|
|Suspend||Pauses a debugging session|
|Terminate||Stops a debugging session|
|Disconnect||Disconnects the debugger from the selected debug target when debugging remotely|
|Remove All Terminated Launches||Clears all terminated debug targets from the display|
|Step Into||Executes code line by line, including included code, UDFs, and CFCs|
|Step Over||Executes code line by line, excluding included code, UDFs, and CFCs|
|Step Return||Returns to the original page from which you entered the included code, UDF, or CFC|
|Drop to Frame||This command is not supported in ColdFusion Builder.|
|Use Step Filters/Step Debug||Ensures that all step functions apply step filters
Debugging lets you examine and troubleshoot your application. When you debug, you can control when the application must stop at specific points in the code. You can also monitor important variables and test your code. Debugging uses a configuration to control how applications are launched. When you debug your application, you run the debug version of the application file.
Before you use the Debugger, ensure the following:
- A server is associated with the project or the project containing the files that you want to debug.
The debugger server listens for commands from ColdFusion Builder on a separate port than the one specified in step 3. By default, ColdFusion launches the debugger server with a random available port. This could be a problem if ColdFusion (and hence debugger server) is behind a firewall.
Because,the firewall blocks the random port that the debugger is listening.
- RDS is enabled on the ColdFusion server, and you have specified the correct RDS configuration information in ColdFusion Builder.
- Debugging is enabled in ColdFusion Administrator.
To prevent this problem, specify a fixed debugger server port number and allow this port in the firewall. To set a fixed debugger server port number, specify the following JVM argument on the Java And JVM page of the ColdFusion Administrator (or the appropriate place for your J2EE Application Server). Replace portNumber with the port that you want to use:
- Restart ColdFusion. If you are running the J2EE configuration of ColdFusion, restart the server in debug mode with the debug port as specified.
If you are not running the server configuration of ColdFusion, specify Java debugging parameters in the configuration file or startup script of the application server you are running. The parameters must look like the following:
Ensure that the port number you specify is the same port number specified on the Debugger Settings page of ColdFusion Administrator.
If you are running the server configuration, ColdFusion writes these debugging parameters to the jvm.config file when you use the Debugger Settings page of the ColdFusion Administrator.
If you are not running the server configuration and your application server is not running on JRE 1.6, copy the tools.jar file of the JDK version that your application server is running to the \lib folder of ColdFusion. For example, if you are running JRun that runs on JRE 1.4, copy the tools.jar file of JDK 1.4 to the \lib folder of ColdFusion.