Debugging Perspective

ColdFusion Debugging perspective

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 ColdFusion Debugging perspective contains the following views:

Debug 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):

Button/command Description
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 applications

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.

While ColdFusion Builder Version 2.0 supported ColdFusion server-side debugging (restricted to the ColdFusion Markup Language syntax), ColdFusion Builder 3, in tandem with the introduction of <cfclient> tag in ColdFusion 11, allows client side debugging to debug client-side JavaScript code.

Using ColdFusion debugger for server-side debugging

Before you use the ColdFusion Debugger, ensure that you do the following:

Set up ColdFusion to use the Debugger

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.
  1. In the Navigator view, right-click the project and select Properties.

  2. In the Properties dialog box, select ColdFusion Server Settings.

  3. Under Select Servers, ensure that a server is selected. If no server is selected, select the Servers drop-down list and select an available server, or select Add Server to configure a new server.

  4. In ColdFusion Administrator, select Debugging & Logging > Debugger Settings.

  5. Select Allow Line Debugging.

  6. Specify the port to use for debugging. The default value is 5005.

  7. Specify the maximum number of simultaneous debug sessions. The default value is 5.

  8. Click Submit Changes.

  9. To increase the time after which requests time out, do the following:

    a. Select Server Settings > Settings. b. Select Timeout Requests After (Seconds) and enter the required timeout value. For example, 300. c. Click Submit Changes.
  10. 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:
-DDEBUGGER_SERVER_PORT=portNumber

  1. Restart ColdFusion. If you are running the J2EE configuration of ColdFusion, restart the server in debug mode with the debug port as specified.

Set up debugging for J2EE configuration of ColdFusion

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:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<port_number>

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.

  1. 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.

  2. If you are running the server version of ColdFusion and you specify a JRE version other than JRE 1.6 in the jvm.config file, copy the tools.jar file of the JDK version specified in your jvm.config file to the \lib folder of ColdFusion.

Specify debugger settings in ColdFusion Builder

  1. In ColdFusion Builder, select Window > Preferences.

  2. In the tree view, select ColdFusion > Debug Settings.

  3. Specify the home page URL that points to the page that appears in the Debug Output Buffer of the debugger when you click the Home button.

  4. Specify the extensions of the types of files that you can debug and debugger scopes that you want the Debugger to recognize. To improve performance when debugging large files, deselect all scopes for which you do not require information

  5. Select Break On CFML Runtime Exception to stop the debugger on the line that causes a ColdFusion error.

  6. Select Log An Exception To The Eclipse Error Log to display the server logs in the TailView view instead of showing a warning dialog.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online