Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using the ColdFusion debugger

From: ColdFusion Builder Essential Training

Video: Using the ColdFusion debugger

Now that you have the debugger for ColdFusion enabled, it's time to start debugging some code in CF Builder. In the Chapter 6 folder, I'm going to switch back to my regular perspective so I can see it. I'll open up index.cfm. Here, I'm setting up an array and then just looping through a list of numbers and dividing the number 1 by each number and then pending the results to my array. If I preview this in my browser here, you'll see I just get an array with each of the results as a separate node in that array.

Using the ColdFusion debugger

Now that you have the debugger for ColdFusion enabled, it's time to start debugging some code in CF Builder. In the Chapter 6 folder, I'm going to switch back to my regular perspective so I can see it. I'll open up index.cfm. Here, I'm setting up an array and then just looping through a list of numbers and dividing the number 1 by each number and then pending the results to my array. If I preview this in my browser here, you'll see I just get an array with each of the results as a separate node in that array.

If I switch back to the source code and set one of these nodes to be the number 0 and run my code again, end up getting a Division by zero error, but I can't actually tell which value in my list caused that problem. To figure out which node in my list is the culprit, I'm going to switch over to the ColdFusion Debugging perspective. In the ColdFusion Debugging perspective, I know that my error is happening on line 3. I know that because here in my Console I can see, it shows the Division by zero error on line 3.

So, to find out what's happening on line 3, I'm going to create a breakpoint by double-clicking on the line number. You'll see it's added a small circle here to show me there's a breakpoint at that line and as I run the ColdFusion debugger, ColdFusion is going to stop on line 3 and tell me all of the values for every variable on my page at that point in time. So, to start the debugger, we'll choose Down arrow next to my little bug, choose Debug As > ColdFusion Application.

My browser pops open and if I switch over to my browser, you can see that it's continually loading. CF Builder is using this browser session so that it can keep track of the variables and then in the Variables section, I can see the value in the Divisor and the value in my Results array. Now to continue process into the next line, I can click the Step Over button and as you can see, I have a little arrow here in my line number, so it shows me which line is getting processed. If I expand my Variables section, I can see that the divisor is still 8 but I now have an entry in my Results array.

I'll step over again. I can see that the divisor is now 7. Step over again and now my Results array has two values in it. So, every time I click Step Over, it's jumping to the top of the loop then stopping on line 3 to tell me everything that's currently set at that point in time and then goes back to the loop. So, I'll click Step Over again, and now I'll fix and now my debugger has stopped working and if I look down here in my console, I can see that the request has exceeded the allowable time limit.

Basically, I took too long to figure out what the problem was with my code. What I need to do now is to stop the debugger and I've terminated processing of that thread and I actually need to tell my page that I need a little bit more time to figure out what's going on. So, we'll use cfsetting and we'll set our requesttimeout to say 240 seconds. That should give me plenty of time to step to the code and figure out exactly what's happening. But this time, I want to be able to more easily see the value of the divisor as I go.

So, I'm going to click on the Expressions view here and I can set up a watch expression that will allow me to see the value of a specific variable at any point in time without having to filter through my Variables list to find it. If I had 10, 15, 20 different variables defined on this page, it'll be hard to pick out the Divisor variable. So, I'm going to click my little Create new watch expression button and I just need to type in the name of the variable that I want to watch. I'll click OK and now I can see that variable set up in the Expressions list.

So, I'm going to go back to the code editor and then we will debug our application again. My browser pops back up. It sends me back to CF Builder and now I can see that the value of the divisor is 8. If I click back on the Variables view, I can see the same thing I saw before. I'll step over 8, 7, now the math for the value 7 has been performed. We'll click on Expressions and we can see that the divisor is 7 there as well.

Click Step Over again, go to the number 6, one more time and go to the number 0, Step Over once more and now I get my division by zero is not allowed. So, that allowed me to see the Divisor variable for every single loop that got processed, so I can finally find out which item in my list was causing the problem. So, now that I know what the issue is, I can take out the problem variable, save my file. I can remove my breakpoint.

I'll run the code one more time. To do that, I need to first terminate the processing. So, you can't open one debugging session while another is up and running. Click in the Editor again and debug one more time, and we can see that the file processed correctly. So, as you can see, the ColdFusion Debugger gives you a lot more detailed view into what your code is doing as it's doing it, the Variables view will show you record sets and column names and column values, add breakpoints and step over lines as you go through the application to quickly find and correct missteps in your code.

Show transcript

This video is part of

Image for ColdFusion Builder Essential Training
ColdFusion Builder Essential Training

40 video lessons · 3962 viewers

Daniel Short
Author

 
Expand all | Collapse all
  1. 7m 48s
    1. Welcome
      59s
    2. Installing ColdFusion Builder
      2m 20s
    3. Installing ColdFusion Builder as a plug-in
      3m 18s
    4. Using the exercise files
      1m 11s
  2. 17m 42s
    1. Workspace overview
      2m 25s
    2. Organizing your workspace
      6m 19s
    3. Adding and selecting workspaces
      2m 53s
    4. Installing and managing plug-ins
      6m 5s
  3. 12m 12s
    1. Creating projects
      2m 11s
    2. Importing projects
      2m 48s
    3. Creating project working sets
      2m 23s
    4. Managing projects
      2m 22s
    5. Linking folders
      2m 28s
  4. 23m 2s
    1. Configuring and managing ColdFusion servers
      6m 26s
    2. Using the Services Browser
      4m 15s
    3. Using RDS Dataview and Fileview
      4m 52s
    4. Using FTP
      7m 29s
  5. 18m 10s
    1. Creating editor profiles
      2m 6s
    2. Using Code Assist
      5m 43s
    3. Setting code coloring
      4m 5s
    4. Using shortcut keys
      3m 5s
    5. Working with outlines and syntax checking
      3m 11s
  6. 37m 40s
    1. Using code completion
      7m 25s
    2. Using snippets
      9m 23s
    3. Using SQL editing and the Query Viewer
      5m 55s
    4. Working with components
      7m 27s
    5. Working with variable mapping
      2m 14s
    6. Navigating code and documents
      5m 16s
  7. 13m 12s
    1. Getting set up
      3m 50s
    2. Using the ColdFusion debugger
      5m 37s
    3. Watching logs with Tailview
      3m 45s
  8. 13m 8s
    1. Installing extensions
      4m 5s
    2. Using the CFC Generator extension for ColdFusion 8
      4m 52s
    3. Using the CFC Generator extension for ColdFusion ORM
      4m 11s
  9. 34m 5s
    1. Building a simple contact form extension
      3m 42s
    2. Creating user interfaces
      8m 55s
    3. Packaging the extension
      3m 55s
    4. Building the handler
      8m 10s
    5. Using the Builder extension
      9m 23s
  10. 25s
    1. Goodbye
      25s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed ColdFusion Builder Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.