Using the Eclipse Debugger Extra Help Session (Christina Aiello)

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Using the SmartPLS Software
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
How Tall Are You? Introducing Functions By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made June 2014 by.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.
1 An Introduction to IBM SPSS PSY450 Experimental Psychology Dr. Dwight Hennessy.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Finding and Debugging Errors
How to Debug VB .NET Code.
Getting Started with Colleague Studio Debugger Presented by:Katie Morgan Pacific University August, 2014.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
Solving Equations with Variables on Both Sides
Macros n Macros are little programs that you can create to automate particular tasks that you may want to execute more easily than having to specify all.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Hitting the Slopes An adventure on the bunny hill of linear equations! Start.
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
Playing Back Scripts In HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>
CSE 332: C++ debugging in Eclipse C++ Debugging in Eclipse We’ve now covered several key program features –Variable declarations, expressions and statements.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Chapter 1 - Getting to know Greenfoot
Debugging Dwight Deugo Nesa Matic
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Summer Computing Workshop. Introduction  Boolean Expressions – In programming, a Boolean expression is an expression that is either true or false. In.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Modifying HTML attributes and CSS values. Learning Objectives By the end of this lecture, you should be able to: – Select based on a class (as opposed.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
NETBEANS DEBUGGER.  To create a breakpoint place the cursor at the desired location.  Go to the Run -> toogle line Breakpoint or Ctrl +F8. It creates.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
11 Debugging Programs Session Session Overview  Create and test a method to calculate percentages  Discover how to use Microsoft Visual Studio.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Debugging What coders (programmers) do to find the errors (“bugs”) in their own programs “Bugs” – Admiral Grace Hopper, developer of the world’s first.
Adding, editing, and deleting items using CONTENTdm Administration.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
CSE 332: Scientific debugging in C++ Scientific Debugging in C++ (with Eclipse & gdb) By now we’ve covered several key C++ features –Variable declarations.
By Melissa Dalis Professor Susan Rodger Duke University June 2011
Debugging with Eclipse
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Click through this presentation at your own pace.
EGR 2261 Unit 5 Control Structures II: Repetition
Appendix A Barb Ericson Georgia Institute of Technology May 2006
CS1101X Programming Methodology
What to do when a test fails
Debugging Dwight Deugo
Computer Programming I
Barb Ericson Georgia Institute of Technology Dec 2009
Important terms Black-box testing White-box testing Regression testing
Programming – Touch Sensors
Important terms Black-box testing White-box testing Regression testing
Debugging with Eclipse
Using a Debugger 1-Jan-19.
Debugging Taken from notes by Dr. Neil Moore
How to Start This PowerPoint® Tutorial
Debugging Taken from notes by Dr. Neil Moore
MACROS MUST BE ENABLED FOR THIS FILE TO WORK
Debugging Visual Basic Programs
Debugging Dwight Deugo
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
Debugging with Eclipse
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Using the Eclipse Debugger Extra Help Session (Christina Aiello)

Why use the debugger? The debugger can show you what values are in variables and what objects exist at a current point in time in your code. With the simple arithmetic that you’ve been doing in your previous homeworks, the debugger doesn’t seem too necessary. However once you move onto working with trees and more complicated structures, the debugger will be incredibly useful. Extra Help Session (Christina Aiello)

How to Place Breakpoints Extra Help Session (Christina Aiello)

Right click to the left of the line of code where you want the breakpoint (click in the light gray bar) and click “Toggle breakpoint” to create a breakpoint. Extra Help Session (Christina Aiello)

Congratulations! You are now the proud owner of your very own breakpoint! Next, how to run debug mode… Extra Help Session (Christina Aiello)

How do I actually use the breakpoints? Extra Help Session (Christina Aiello)

Rather than using the green “run” button, you’re going to run the code in debug mode with the debug button:

Remember how you had to click the arrow to the right of the “run” button and set up configurations to get it to run the tester’s main? Click the arrow to the right of the debug button, and select the configuration you made. If you want to make sure you have the right configuration, you can click “Debug Configurations” which will bring up a window that looks very similar to the Run Configurations window. In that window, be sure that you have the right project name and that tester’s main is selected. Extra Help Session (Christina Aiello)

The green-highlighted line shows where you currently are when stepping through your code. Extra Help Session (Christina Aiello)

Click the yellow arrow that is the “step into” button to step into this line of code and see what happens when the line is run. Extra Help Session (Christina Aiello)

Recall that this is where we were before we clicked “step into:” Clicking “step into” has now brought us here: We are now in the winner method, which was the method that was called in our previous line that we were at. Now, what’s going on here? What does “results.determineWinner()” actually do? Let’s step into it! Click “step into” again. Extra Help Session (Christina Aiello)

Clicking “step into” again now takes you to the determineWinner helper method within the RoboticsResult class: The first thing that the determineWinner method does is call a helper method that I named “teamFinalScore.” If you want to see what this method does, click “step into” again. Extra Help Session (Christina Aiello)

If I click “step into,” this takes me into the teamFinalScore helper that I made to calculate a team’s score. As you can see, this method is going to add up the points and tasks values passed into the method, and then if the teamFell boolean is true, it will subtract 5 from the team’s final score. Extra Help Session (Christina Aiello)

Now you could click “Step into,” but since there are no new methods being called, so you can either click that or “Step Over” which will take you to the next line. Extra Help Session (Christina Aiello) As a reminder, this is the “Step Into” button that we were using before, and it is to the right of the “Step Over” button.

Now we’ve stepped to the line that says “return teamFinalScore”. But what is this teamFinalScore? It’s an integer, but what integer value is inside of it? Extra Help Session (Christina Aiello)

Now, see the “variables” tab? This will show you what value is inside of each variable! Let’s look closer at this. Extra Help Session (Christina Aiello)

Currently we have five variables. We have “this,” which is a RoboticsResult. This is the object that you’re inside of right now. We have “points,” which is the “int points” we passed into the teamFinalScore method. This has a value of 10 right now. We have “tasks,” which is the “int tasks” that we passed into the teamFinalScore method. This has a value of 3. We have the boolean “teamFell” that we passed into the teamFinalScore method, which is true. Lastly, we have “teamFinalScore,” the value we will be returning (see the line highlighted in green). After doing our calculations, the teamFinalScore that we will be returning is 8, as you can see in the “Variables” tab above. Now click “step over” or “step into.” Both will do the same thing at this point. Extra Help Session (Christina Aiello)

We’re back here now! The debugger just showed you all of the steps that occur in the line highlighted in green below, the method teamFinalScore. Hit “step over” one more time… Extra Help Session (Christina Aiello)

You’re now on the next line, and if you look in the “Variables” tab, you can see the calculated value of the integer team1FinalScore, which is 8! Extra Help Session (Christina Aiello)

Ta-da! There are the basics of using the debugger in Eclipse. Extra Help Session (Christina Aiello)

One last thing: How to disable and how to delete breakpoints? Extra Help Session (Christina Aiello)

To hide the breakpoint (so your code won’t stop here when you’re stepping through it with the debugger) but still keep it there, right click and select “Disable breakpoint”: Extra Help Session (Christina Aiello) It should now look like this:

To completely delete the breakpoint, right click and select “Toggle breakpoint” again. This will remove it completely. Extra Help Session (Christina Aiello)