As FusionDebug works on the Eclipse Platform, it can take advantage of many useful Eclipse features and shortcuts. This page lists many useful configuration options to allow users get the most out of FusionDebug aiding a more effective and efficient debugging experience.
Common Tips And Tricks
- How do I turn on line numbers?
- How do I turn on/change the colour of the highlight bar?
- How do I group my breakpoints?
General Tips and Tricks
- I'm trying to figure out how to fix a setting in the Eclipse preferences. There are just so many. How does one find what they want?
- I'm about to move from one version of FD to another. Is there any way I can preserve my breakpoints?
- When I look at the Variables or Expressions panes, there are sometimes so many of them to expand and view. Is there an easy way to search through them?
- Sometimes when I am viewing the list of Variables I want to copy a variable or its value to the clipboard. Is there a way to do that?
- I'd like to be able to debug JavaScript. Does FD help with that?
- You Can Debug Against More than Just Your Local Developer Edition of CFMX.
- You Can Change Variables on-the-Fly.
- Tricks in Variables and Expressions Panes.
- Manipulating Breakpoints.
- Catching ColdFusion Exceptions with FusionDebug.
Useful Shortcuts
If you cant find what you are looking for why not check out the FusionDebug Google Discussion Group.
Common tips and tricks
How do I turn on line numbers?
- Select the "Preferences" menu item from the "Windows" menu.
- For the standard Eclipse text editor:
- Open the "General" and "Editors" nodes and click on "Text Editors"
- Open the "CFEclipse" node and click on "Editor"
- Select the "Show line numbers" checkbox.
How do I turn on/change the colour of the highlight bar?
- Select the "Preferences" menu item from the "Windows" menu.
- For the standard Eclipse text editor:
- Open the "General" and "Editors" nodes and click on "Text Editors"
- Open the "CFEclipse" node and click on "Editor"
- In the Appearance color options select Current line Highlight and choose a color. Apply this change.
How do I group my breakpoints?
- Open the Breakpoints View and click on the menu icon. (Little white downwards facing arrow on the right hand side of the View)
- For Eclipse 3.1: Open the "Show" sub-menu
For Eclipse 3.2: Open the "Group by" sub-menu - Select "Projects"
General Tips and Tricks
I'm trying to figure out how to fix a setting in the Eclipse preferences. There are just so many. How does one find what they want?
Eclipse has a really cool feature that you can easily miss.When in
Window > Preferences
notice that there's prompt in the upper left of the window for "type filter text".
What that does is let you search for settings. So if you wondered about how to set line numbers, for instance, just type "line". It shows all the settings that refer to that string
and as an earlier tip pointed out, the way to do line numbers is in:
General > Editors > Text Editors
I'm about to move from one version of FD to another. Is there any way I can preserve my breakpoints?
Yes, there is an option to Export breakpoints. Open the breakpoints wiew and select your relevant project / file(s), right click and select the "Export Breakpoints" menu item.
When I look at the Variables or Expressions panes, there are sometimes so many of them to expand and view. Is there an easy way to search through them?
Yes, there is. Both the Variables and Expressions panes have a find feature. Either right-click and choose find, or while the focus is on the desired pane, use Ctrl-F.
Note as well that there are available wildcards: ? and *
Sometimes when I am viewing the list of Variables I want to copy a variable or its value to the clipboard. Is there a way to do that?
Yes, you can copy variable values to the clipboard by right-clicking on a variable, or on the heading for a group of variables, and choose "copy variables". It will copy both the variable name and its value. If you are on a group of variables, it will copy them all. You can also do a copy of expressions.
I'd like to be able to debug JavaScript. Does FD help with that?
No, FD is only a CFML debugger. There are other JS debuggers for Eclipse out there. A popular one is "MyEclipseIDE":
http://www.myeclipseide.com/ContentExpress-display-ceid-70.html#jsdebug
And a tip, not Eclipse-generic, but FD-specific:
When stepping through code, favor "step over" versus "step into". In other words, if you're on a tag or expression that would not possibly go "into" some other file, don't use "step into". It may seem like it shouldn't matter in that case, but especially in FD 1.0, doing a "step into" on some tags or expressions can take much longer than if you just used "step over" instead.
You Can Debug Against More than Just Your Local Developer Edition of CFMX.
Most debugging tools work against a local copy of whatever application you're debugging, but FusionDebug can be configured to debug code running on a remote CFML server too such as a central staging or perhaps even a production server. It could even be a remote hosted server.
You Can Change Variables on-the-Fly.
Don't miss the fact that the tool is for more than just watching what's happening. It also offers the option of changing the variables' values on-the-fly. While at a breakpoint or stepping through code, highlight a variable you'd like to set and right-click "Set Variable" to give it a new value. That new value will immediately be set in the currently running request.
Tricks in Variables and Expressions Panes.
Don't miss the fact that the tool is for more than just watching what's happening. It also offers the option of changing the variables' values on-the-fly. While at a breakpoint or stepping through code, highlight a variable you'd like to set and right-click "Set Variable" to give it a new value. That new value will immediately be set in the currently running request.
To set a watch expression, you can either highlight it in the editor, right-click and choose "watch expression," or right-click in the expression pane and choose "add watch expression." Finally, you can right-click on an existing expression and choose "edit expression" to change the expression.
If you want to save the value of some variable as shown in the variables pane, notice the "copy variables" option.
Manipulating Breakpoints
After working with the FusionDebug for a while, you may start to have a large number of breakpoints show up in the breakpoints pane. A nifty trick is to group them (group their display) by choosing the rightmost icon (or "view action") in its toolbar, the down arrow, and "group by," and then select a value by which to group the breakpoints. Options include grouping them by the file or project in which they appear. Another option is to create "working sets" of breakpoints that are related in some way you define. They can then be grouped by those working sets and you can move the breakpoints around to appear in those working sets.
If you wanted to remove breakpoints for reuse later, you can also right-click in the breakpoints pane and export or import them.
Catching ColdFusion Exceptions with FusionDebug
Using this method it is possible to use FusionDebug to catch exceptions that your ColdFusion page has thrown. This is especially useful in situations such as Flex, Ajax or WML application development where you are calling ColdFusion over a gateway. In these situations your request simply exists and have no chance to see the standard error page which ColdFusion would usually write to a HTML based application.
If you are using CFMX 7 then create an Application.cfc (or modify your existing Application.cfc) and add an onError method. In this method you just rethrow your exception and set a breakpoint on that line. When an error occurs, FusionDebug will fire and you will have access to all of the exception information which would typically be thrown to a web page. (Look inside the "Function Local" scope within the "Variables" pane).
Here is an example onError method:
<cfcomponent>
<cffunction name="onError">
<cfargument name="Except" required=true/>
<cfargument type="String" name = "EventName" required=true/>
<cfrethrow> <!--- Set breakpoint here --->
</cffunction>
</cfcomponent>
If you are using CFMX 6.1 then you will instead need to use the tag. When placed in your application.cfm, the tag lets you create custom error pages for you CF application. By creating a custom error page and setting a breakpoint in that page, we can get access to the error details. Here is an example of the line you would need to put into your application.cfm:
<cferror type="exception" template="myException.cfm">
The "myException.cfm" file just needs to contain something like this:
<cfset temp="Set breakpoint here">
Once your breakpoint fires you will have access to the error details by opening
VARIABLES --> ERROR within the Variables Pane.
Useful Shortcuts
Available Shortcuts
Besides using the mouse-based icons and context menus, there are several keyboard shortcuts available. To set a breakpoint, use ctrl-shift-b. To effect the "step over," use F6. For the "step return" command use F7, and for "Resume" use F8.
It's worth noting that the Run menu shows all the other stepping and related commands, so you don't have to use just the icons and keyboard shortcuts for stepping. This makes it clear that the debug commands used in FusionDebug are actually Eclipse commands, so you can learn more about some of these features in the general Eclipse documentation and other resources.
Though not a "keyboard" shortcut, note that you can double-click on a breakpoint in the breakpoints pane and FD will open the file at that specific line. Similarly, when at a breakpoint or while stepping, you can double-click on a file in the "stack trace" (showing the current template and line number on which execution has stopped) and that will jump to the appropriate line too. This can be especially helpful when you're several files deep (perhaps a file has called a CFC method that has done a CFINCLUDE).
Shortcuts within the debugger perspective
- Note: these shortcuts must be used in the debug perspective
- Ctrl+shift+L -> Key Assist
- F5 -> Step Into
- F6 -> Step Over
- F7 -> Step Return
- F8 -> Resume
- Ctrl+shift+B -> Toggle Breakpoint On/Off
Shortcuts within CFEclipse
- Some useful shortcuts for CFEclipse:
- Ctrl+Space -> Content Assistance
- Ctrl+Shift+D -> cfdump
- Ctrl+Shift+R -> cfscript
- Ctrl+Shift+O -> cfoutput
If you cant find what you are looking for why not check out the FusionDebug Google Discussion Group.
Content used with kind permission from Charlie Arehart.For more information see: http://www.carehart.org/.

