LESSON 20.

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

11-Jun-14 The assert statement. 2 About the assert statement The purpose of the assert statement is to give you a way to catch program errors early The.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
Overview of Previous Lesson(s) Over View 3  Debugger  A computer program that is used to test and debug other programs.  Local Debugging  Debugging.
Overview of Previous Lesson(s) Over View  Assertions  assert() library function is declared in the cassert header to check logical conditions in native.
BIM313 – Advanced Programming Techniques Debugging 1.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
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.
VB – Debugging Tools Appendix D. Why do we need debugging? Every program has errors, and the process of finding these errors is debugging Types of errors.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
CPS120: Introduction to Computer Science Lecture 14 Functions.
CSE 332: C++ debugging Why Debug a Program? When your program crashes –Finding out where it crashed –Examining program memory at that point When a bug.
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.
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.
Georgia Institute of Technology Creating Classes part 2 Barb Ericson Georgia Institute of Technology June 2006.
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.
Minimal standard C program int main(void) { return 0 ; }
11 Debugging Programs Session Session Overview  Create and test a method to calculate percentages  Discover how to use Microsoft Visual Studio.
Debug in Visual Studio Windows Development Fundamentals LESSON 2.5A.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
CSC 1201 LAB RULES Nouf Aljaffan (C) CSC 1201 Course at KSU.
Copyright Ó Oracle Corporation, All rights reserved Debugging Triggers.
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Harvard Mark I Howard Aiken was a pioneer in computing and a creator of conceptual design for IBM in the 1940s. He envisioned an electro-mechanical computing.
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.
Debugging with Eclipse
How to debug an application
ECE Application Programming
Debugging and Troubleshooting Code
Dept of Computer Science University of Maryland College Park
LESSON 18.
Debugging Dwight Deugo
Eclipse Navigation & Usage.
Testing and Debugging.
Computer Programming I
Debugging CMSC 202.
Chapter 5 Conclusion CIS 61.
Testing Key Revision Points.
Barb Ericson Georgia Institute of Technology Dec 2009
CSS 161: Fundamentals of Computing
Using Visual Studio with C#
Important terms Black-box testing White-box testing Regression testing
Important terms Black-box testing White-box testing Regression testing
Microsoft Visual Basic 2005 BASICS
Unit 1: Introduction Lesson 1: PArts of a java program
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
Tonga Institute of Higher Education
Debugging at Scale.
Debugging Taken from notes by Dr. Neil Moore
When your program crashes
Testing, debugging, and using support libraries
POWERPOINT PRESENTATION
Our Environment We will exercise on Microsoft Visual C++ v.6
elementary programming
ECE 103 Engineering Programming Chapter 56 Runtime Errors
Debugging Taken from notes by Dr. Neil Moore
Debugging Visual Basic Programs
IDE’s and Debugging.
Module 6: Debugging a Windows CE Image
Debugging Dwight Deugo
Yan Shi CS/SE 2630 Lecture Notes
Computer Organization and Assembly Language
UNIT 1 First programs.
Presentation transcript:

LESSON 20

Overview of Previous Lesson(s)

Over View Debugger A program that controls the execution of program code in such a way that we can step through the source code one line at a time, or run to a particular point in the program. A breakpoint is a point in our program where the debugger automatically suspends execution when in debugging mode. A trace-point is a special kind of breakpoint that has a custom action associated with it.

Over View.. Following are the ways of starting application in debug mode.

Over View... Local tab Auto Tab Threads Tab The Locals tab shows the values of the variables local to the current function. Auto Tab Shows the automatic variables in use in the current statement and its immediate predecessor. Threads Tab Allows to inspect and control threads in advanced applications

Over View... Modules Tab Watch1 Tab Lists details of the code modules currently executing. Watch1 Tab Variables can be added to the Watch1 tab that we want to watch.

Over View… #include <cassert> void assert(int expression); #define NDEBUG // Switch off assertions in the code #include < cassert > // Declares assert()

TODAY’S LESSON

Contents Customized Debugging Code Debugging a program The Call Stack Step Over to the Error

Customized Debugging Code Customized debugging code is aimed at highlighting bugs wherever possible and providing tracking output to help you pin down where the bugs are. Line by line debugging is monotonous & longish. Only required in testing a phase.

Customized Debugging Code.. This overhead is not needed in the final version. So this code only operates in the debug version of a program, not in the release version. The output produced by debug code provide clues as to what is causing a problem.

Adding Code Using preprocessor directives, a programmer can add any code to the program. Preprocessor symbol, DEBUG, is always defined automatically in Visual C++ in the debug version of a program, but is not defined in the release version. Debugging code is enclosed between a preprocessor #ifdef / #endif pair of directives.

Adding Code.. #ifdef _DEBUG // Code for debugging purposes... #endif // _DEBUG The code between the #ifdef and the #endif is compiled only if the symbol DEBUG is defined.

Adding Code... The debug code can do anything that is helpful in the debugging process. Simply outputting a message. To trace the sequence of execution to providing additional calculations to verify and validate data, or calling functions providing debug output.

Adding Code... Many blocks of debug code can be written in the source program. Can use customized preprocessor symbols to provide more selectivity as to what debug code is included. Ex .. some of debug code may produce voluminous output and only want to generate when it was really necessary. To provide granularity in debug output, so we can pick & choose which output is produced on each run.

Adding Code... The following directives will ensure that these symbols are defined only if DEBUG is defined: #ifdef _DEBUG #define MYDEBUG #define VOLUMEDEBUG #endif Lets try it …

The Call Stack The call stack stores information about functions that have been called and are still executing because they have not returned yet. Call stack window shows the sequence of function calls outstanding at the current point in the program.

The Call Stack.. The sequence of function calls outstanding runs from the most recent call at the top.

Thank You