
If you are a veteran ColdFusion programmer you may remember a little-known feature of ColdFusion 4.5 and 5. Before ColdFusion MX was redesigned to take advantage of the J2EE platform, ColdFusion Studio (the official ColdFusion IDE from Allaire Corporation) included a step-through debugger. In the early days of ColdFusion development, the step-through debugger was essential in identifying how your code was being executed.
The need for the code debugger was greatly diminished in ColdFusion 5 with the addition of the cfdump tag. The cfdump tag offered developers an simple way to debug variables at any stage of execution by displaying variables inline as HTML. Today, developers are defining the next generation of rich Internet applications with ColdFusion, Flex, and Ajax. Most of these service-based applications may never generate HTML at all; thus, you need something more than the cfdump tag for complex debugging.
Adobe ColdFusion 8 reintroduces step-through debugging with a free extension for Eclipse. Originally developed by IBM, the open-source Eclipse project offers developers the freedom to customize their development environment. Adobe Flex Builder 2 is also built on Eclipse, which means you can integrate the ColdFusion 8 step-through debugger directly into Flex Builder or into a stand-alone installation of Eclipse.
Step-through debugging allows you to place a breakpoint on any line of CFML code. Upon execution, ColdFusion will pause the request when it reaches the breakpoint and report the current values of the existing variables along with other diagnostic information. You can step through multiple breakpoints to analyze the request at different lines of execution.
Because step-through debugging is integrated directly into the ColdFusion 8 server, you may have multiple debug sessions running concurrently, a feature not supported by other third-party debugging tools for ColdFusion. Another feature of the ColdFusion 8 step-through debugger is the ability to trigger debug sessions from outside of the IDE. This means you can set a breakpoint in a CFC that is being called from a rich Internet application such as Adobe Flex, Adobe Flash, and Ajax applications. The ColdFusion debug session will be triggered when Adobe Flash Player calls the CFC and reaches the breakpoint. You can also debug CFCs called as web services regardless of where the request originated from.
In this article you will learn how to set up and use the new ColdFusion 8 step-through debugger for Eclipse, as well as learn how to set breakpoints and step though your code.
In order to make the most of this article, you need the following software:
Knowledge of Eclipse IDE and ColdFusion administrator.
Brian Szoszorek has been developing ColdFusion applications since 2000. He is a certified ColdFusion developer and the chief technologist of New Point Media. He has worked and provided consulting services to companies such as New Era Cap Company, XL Capital, Spire Systems, and Adobe Systems. Brian is a strong evangelist for how ColdFusion, Flex, Adobe AIR, and the Flash Platform as they provide higher productivity and richer experiences compared to competing technologies.