developer | thinker | tinkerer

Finding CFDUMP Line Numbers

  • Friday, July 22 2011

There was some discussion on Twitter about line numbers and CFDUMP.

I wish CFDumps showed the file and line where the dump came from. #coldfusion that would really help at times!

This is easy if you are using ColdFusion Builder and CFEclipse!

First setup a custom Task Tag.

In ColdFusion Builder navigate to ColdFusion > Profiles > Editor > Task Tags.

Click "New", and enter CFDUMP for your task name. I set these to 'high' priority.

Now when you add a cfdump tag - add a CFDUMP comment with it.

<!--- CFDUMP: Debugging --->
<cfdump var="#myVar#" top=2 label="MyDump ( myVar)" abort="true">

You can do this through a snippet or I prefer to use AutoHotkey...

;-- Wrap selected text in CFDump/CFAbort ---
; whatever hot key combo you want - I use F1
  clipboard =

  send ^c
    clipwait, 1

  If ErrorLevel = 0
    clipboard = <!--- CFDUMP: Debugging --->`n<cfdump var="#%clipboard%#" top=2 label="My Dump ( %clipboard% )" abort="true">`n
    send ^v

So I simply select my text, hit F1 and the selected text is written to my clipboard, wrapped in the comment and cfdump and then printed out to the screen.

Once your comment is in place - simply open the Tasks view in Eclipse and your CFDUMPS should appear in the list along with a column that displays what line number!


SQL Server - Useful Tools Automated Merge Notices