Debuggers in Python. The Debugger Every programming IDE has a tool called a debugger. This application does NOT locate or fix your bugs for you! It slows.

Slides:



Advertisements
Similar presentations
VCE SD Theory Slideshows By Mark Kelly Vceit.com Debugging Techniques.
Advertisements

COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Recursion in Python. Recursion Problems in every area of life can be defined recursively, that is, they can be described in terms of themselves. An English.
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Ten debugging techniques. The execution process Execution proceeds in a standard series of steps Compute values of subexpressions first Then call value.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
CS 225 Lab #2 - Pointers, Copy Constructors, Destructors, and DDD.
CS 2511 Fall  Windows:  Start->Specialized Academic Software- >Programming Languages->NetBeans->NetBeans IDE x.y.z  where x.y.z is a version.
CIT 590 Debugging. Find a laptop Please take a moment to open up your laptop and open up Eclipse. If you do not have a laptop, please find a friend. If.
Compilers and Interpreters. Translation to machine language Every high level language needs to be translated to machine code There are different ways.
Python quick start guide
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Using a Debugger. SWC What is ”debugging”? An error in a computer program is often called a ”bug”… …so, to ”debug” is to find and get rid of errors in.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
Debugging Projects Using C++.NET Click with the mouse button to control the flow of the presentation.
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
1 Debugging: Catching Bugs ( II ) Ying Wu Electrical Engineering & Computer Science Northwestern University EECS 230 Lectures.
COMP 121 Week 1: Testing and Debugging. Testing Program testing can be used to show the presence of bugs, but never to show their absence! ~ Edsger Dijkstra.
FireBug. What is Firebug?  Firebug is a powerful tool that allows you to edit HTML, CSS and view the coding behind any website: CSS, HTML, DOM and JavaScript.
Structured Programming: Debugging and Practice by the end of this class you should be able to: debug a program using echo printing debug a program using.
Debugging and Profiling With some help from Software Carpentry resources.
Debugging Xin Tong. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
Copyright © 2004 – 2013 Curt Hill Java Debugging In Eclipse.
1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall.
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.
CS 177 Week 10 Recitation Slides 1 1 Debugging. Announcements 2 2.
CHAPTER 10 ERROR HANDLING & DEBUGGING JavaScript can be hard to learn. Everyone makes mistakes when writing it.
Debugging What coders (programmers) do to find the errors (“bugs”) in their own programs “Bugs” – Admiral Grace Hopper, developer of the world’s first.
An introduction to the debugger And jGrasp editor-syncrasies (ideosyncrasies)
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
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.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
MOOR ERROR HANDLING Types of error How to test your code for errors How to detect errors How to recover from errors.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Testing and Debugging UCT Department of Computer Science Computer Science 1015F Hussein Suleman March 2009.
Gnu Debugger (gdb) Debuggers are used to: Find semantic errors Locate seg faults and bus errors Prepared by Dr. Spiegel.
Structured Programming The Basics
Error Analysis Logic Errors.
Gnu Debugger (gdb) Debuggers are used to: Find semantic errors
14 Compilers, Interpreters and Debuggers
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Computer Programming I
Think What will be the output?
LESSON 20.
Testing Key Revision Points.
Lesson Outcomes Be able to identify differentiate between types of error in programs Be able to interpret error messages and identify, locate.
DEBUGGING.
Call Stacks, Arguments and Returns
Debugging with Eclipse
Programming Problem solving Debugging
Program Flow CSCE 121 J. Michael Moore.
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
Debugging CSCE 121 J. Michael Moore.
Tonga Institute of Higher Education
Using a Debugger 1-Jan-19.
Debugging Taken from notes by Dr. Neil Moore
Testing, debugging, and using support libraries
Debuggers and Debugging
Debugging Taken from notes by Dr. Neil Moore
IDE’s and Debugging.
jGRASP editor-syncrasies (idiosyncrasies)
Chapter 15 Debugging.
Debugging with Eclipse
Hello World Program In Visual Studio and Debugging
Chapter 15 Debugging.
Presentation transcript:

Debuggers in Python

The Debugger Every programming IDE has a tool called a debugger. This application does NOT locate or fix your bugs for you! It slows the program down by letting you ‘single-step’ through it You can check your understanding of the code as it goes by It shows you the variables that are created and their values It shows you the call stack of function calls that have been done

Breakpoints In order to step through your program one statement at a time, you must first set a breakpoint. If your program is a straight sequence, you may need only one. If you have branches and loops, you may need several to make sure the execution does actually hit one. When the program is running under the Debugger, it will run normally (at normal speed) until a breakpointed statement is about to execute. Then the interpreter gives control to you the programmer, it pauses the program and shows the current state of the program.

Stepping Step Over (Over in IDLE) “the next statement to execute has a function call in it, I do NOT want to see the details of that call. Just do the call and pause at the next statement” Step Into (Step in IDLE) “The next statement to execute has a function call in it, I DO want to see the details of that call. Get to the top of the function definition and pause” Step Out of (Out in IDLE) “I have stepped into a function which I did not meant to. Please finish the function call quickly and then pause”

Watch window For your debugger, check to see where the watch window is That is where the variables are shown as they are defined and destroyed Their value is shown, usually their type When you step through a statement, watch this window to see how a variable changes In IDLE the window is labeled “Locals” In WingIDE it is labeled “Stack Data”

Call stack This keeps track of the current function call In WingIDE it is a window usually to the right which grows downward as more functions are called In IDLE it is the list of statements that is in the main Debug window, it also grows downward as more functions are called – it is NOT labeled “call stack”