Debugging CSCE 121 J. Michael Moore.

Slides:



Advertisements
Similar presentations
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Advertisements

ECE Application Programming
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
Well-behaved objects Debugging. 2 Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Prevention vs Detection.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
1 Gentle Introduction to Programming Tirgul 2: Scala “hands on” in the lab.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Debugging Logic Errors CPS120 Introduction to Computer Science Lecture 6.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Warmup Write a function to add two integer parameters and return the result.
Debugging Projects Using C++.NET Click with the mouse button to control the flow of the presentation.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
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.
ME 142 Engineering Computation I Debugging Techniques.
Chapter 8 Repetition Statements. Introduction Iteration - process of looping or the repetition of one or more statements Loop body - the statement, or.
Debugging and Profiling With some help from Software Carpentry resources.
Java Basics Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
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.
C++ crash course Class 9 flight times program, using gdb.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
Copyright © 2004 – 2013 Curt Hill Java Debugging In Eclipse.
©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.
Georgia Institute of Technology Creating Classes part 2 Barb Ericson Georgia Institute of Technology June 2006.
1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
CS 177 Week 10 Recitation Slides 1 1 Debugging. Announcements 2 2.
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)
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
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.
Gnu Debugger (gdb) Debuggers are used to: Find semantic errors Locate seg faults and bus errors Prepared by Dr. Spiegel.
Lab 4: Loops and Iteration Graham Northup
Debugging with Eclipse
Gnu Debugger (gdb) Debuggers are used to: Find semantic errors
Programming and Debugging with the Dragon and JTAG
14 Compilers, Interpreters and Debuggers
ME 142 Engineering Computation I
ECE Application Programming
Testing and Debugging PPT By :Dr. R. Mall.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Testing and Debugging.
Debugging CMSC 202.
2_Testing Testing techniques.
COMP 2710 Software Construction Introduction to GDB
Debugging with Eclipse
Variables with Memory Diagram
Debuggers.
Chapter 15 Debugging.
Program Flow CSCE 121 J. Michael Moore.
Comp 110/401 Appendix: Debugging Using Eclipse
How Functions Work Part 1
Tonga Institute of Higher Education
Debugging at Scale.
Using a Debugger 1-Jan-19.
Debugging Taken from notes by Dr. Neil Moore
Chapter 15 Debugging.
DEBUGGING CS2110.
Testing, debugging, and using support libraries
Debugging “Why you were up till 2AM”
Basic Debugging (compilation)
Debugging Taken from notes by Dr. Neil Moore
jGRASP editor-syncrasies (idiosyncrasies)
Warmup Write a function to add two integer parameters and return the result.
Debugging.
Debugging CSCE 121.
Debugging with Eclipse
Presentation transcript:

Debugging CSCE 121 J. Michael Moore

Early Bug

“If debugging is the process of removing software bugs, then programming must be the process of putting them in.” Edsger Dijkstra

Debugging Figuring out what is wrong with the code we wrote… Analyze problem Compare program results with hand executed results. A couple of tools Judicious use of print statements (i.e. cout) Careful use of debugging tool.

Print Statements Sometimes you have no choice. Print out data at different points in the program. Make certain you can determine where a particular output comes from. Examples Starting function X Ending function X Value(s) before processing/calculation Value(s) after processing/calculation

Debuggers Allow you to look at things while the program is running. At any point in the program, you can see the call stack. Local variables and parameter values.

Breakpoints Breakpoints can be placed on any executable statement in your code. When the program executes, it will pause at a breakpoint. You can look at variable values, etc.

Moving Through Code Once stopped you can execute the code line by line. Three options Step Over Move to the following statement. This will not enter any functions called on the current line (unless it finds another breakpoint in a function called before the next line). Step Into Go into the next function on the current line (if there is one.) Note: functions may be nested. Step Out Stop going line by line in the current function and move to the next line of code in the calling function.

More? There is a lot more out there regarding debugging. However, these basics should help you tremendously as you gain experience programming. If you find you need more, you can do some self teaching!