Ten debugging techniques. The execution process Execution proceeds in a standard series of steps Compute values of subexpressions first Then call value.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
1 Microsoft Access 2002 Tutorial 9 – Automating Tasks With Macros.
ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
1 The Call Stack (Exceptions revisited). 2 The Call Stack When method calls are made, the programming language must keep track of who called who  … and.
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Six compound procedures and higher-order procedures.
Automating Tasks With Macros
Chapter 5 - Menus, Sub Procedures, and Sub Functions  Menus - controls - properties and events –menu editor - create and change –defining menus - menu.
E.1 Eclipse. e.2 Installing Eclipse Download the eclipse.installation.exe from the course web site to your computer and execute it. Keep the destination.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
How to Debug VB .NET Code.
Visual Basic Debugging Tools Appendix D 6/27/20151Dr. Monther Aldwairi.
JavaScript, Fourth Edition
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Programming a GUI Hanan sedaghat pisheh. For calling GUI, we need a function with no inputs or outputs First We create a m.file m file has the same name.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Debugging Projects Using C++.NET Click with the mouse button to control the flow of the presentation.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 8 Formula Auditing, Data Validation, and Complex Problem Solving.
CSE 332: C++ debugging in Eclipse C++ Debugging in Eclipse We’ve now covered several key program features –Variable declarations, expressions and statements.
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.
ME 142 Engineering Computation I Debugging Techniques.
Program Errors and Debugging Week 10, Thursday Lab.
Visual Basic.NET BASICS Lesson 5 Exponentiation, Order of Operations, and Error Handling.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Allegro CL Certification Program Lisp Programming Series Level I Session Basic Lisp Development in the IDE.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
CS320n –Visual Programming More LabVIEW Foundations.
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.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
1 Chart of Accounts Group Maximums 5/17/06 (Updated 10/18/13)Fiscal Mentor Meeting.
Visual Basic CDA College Limassol Campus COM123 Visual Programming 1 Semester B Lecture:Pelekanou Olga Week 5: Useful Functions and Procedures.
Lesson 1. Security At the menu bar at the top you will see the word Tools. Click your mouse on Tools scroll down to Macro. Move the Mouse over and down.
5.01 Understand Different Types of Programming Errors
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
17/02/2016S. Ponce / EP-LBC1 Debugging Under Linux Sebastien Ponce Friday, 8 March 2002.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Testing i. explain the importance of system testing and installation planning;
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
5.01 Understand Different Types of Programming Errors
User-Written Functions
ME 142 Engineering Computation I
How to debug an application
PYGAME.
Eclipse Navigation & Usage.
Section 64 – Manipulating Data Using Methods – Java Swing
Computer Programming I
Testing Key Revision Points.
DEBUGGING.
Variables and Arithmetic Operations
5.01 Understand Different Types of Programming Errors
Functions A function is a “pre-packaged” block of code written to perform a well-defined task Why? Code sharing and reusability Reduces errors Write and.
Messages and Input boxes
Debugging Taken from notes by Dr. Neil Moore
Debugging Taken from notes by Dr. Neil Moore
Debugging Visual Basic Programs
How to debug a website using IE F12 tools
Presentation transcript:

ten debugging techniques

The execution process Execution proceeds in a standard series of steps Compute values of subexpressions first Then call value of first subexpression With values of other subexpressions as inputs The most important thing for the programming portion of this class is to learn the rules of execution [+ [× 2 a] (assuming a=7, b=8) b] Look up +  procedure Compute [× 2 a] Look up ×  procedure “Execute” 2  2 Look up a  7 Call the procedure with 2 and 7 as inputs Return 14 Look up b  8 Call procedure with 14 and 8 as inputs Return 22

The stack The system keeps track of its what it’s executing using a stack The stack holds the expressions and subexpressions being executed Each time it starts a new subexpression, it’s added to the stack Every time it finishes a subexpression, it’s removed Starting stack: [+ [× 2 a] b] Later: [× 2 a] [+ [× 2 a] b] Later: 14 [+ [× 2 a] b] Later: 22

Single-stepping You can watch the execution of an expression by using the “Execute 1 Step” command The system will display the stack after one step of execution Notice that it appears in the debugger window

Single-stepping Doing “Execute 1 Step” again, executes one more step and redisplays the stack You can type control-1 instead of selecting “Execute 1 Step” from the Execute menu

Single-stepping Lines in normal font are the expressions being executed Lines in boldface show the procedure calls Give the actual arguments being passed to the procedures

Single-stepping Lines that are just numbers are the outputs of procedure calls So the result of [× 2 a] was 14

Single-stepping Once the [× 2 a] subexpression has been executed We have the inputs for + And can call it

Single-stepping And get the final answer

Single-stepping FYI: You can’t execute a new command while single- stepping another Closing the debugger window aborts the current command

Handling errors Suppose we type: [define square [n → [× n n]]] [square box] We get an error And the debugger pops up

Handling errors Clicking the [explain] box will show you a general explanation of the type of error this is and its likely causes

Handling errors The title bar now shows the error message And the stack shows The exception that occurred And the current state of the stack when the error occurred (Note: we can’t single-step it anymore because the computation has failed)

Handling errors The procedure running is a call to × With the inputs:, and is the system’s way of saying The data object being passed as input is a procedure named name So we know that the × procedure was called with two procedures as its input But it needs numbers as its input

Handling errors Why is it getting called with procedures as arguments? Well, we can see the procedure was called as part of executing [× n n] Click on the [× n n] expression …

Handling errors Click on the [× n n] expression … … and it gives us the values of the local variables So n was set to the box procedure Now click the  to return to the stack

Handling errors We can also see that was an argument to square And the expression that called square was [square box] So the problem is that we passed a nonsensical argument to sqaure

Handling errors When you finish gathering information from the debugger Click the close box to remove it