Debugging in Visual Studio - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Debugging in Visual Studio

Description:

A fault occurs when a human makes an error. ... Autos Window. shows variables used by the current and previous statements. Locals Window ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 13
Provided by: timothym2
Category:

less

Transcript and Presenter's Notes

Title: Debugging in Visual Studio


1
Debugging in Visual Studio
Materials used in this presentation may be
downloaded from acm . southalabama . edu /
Mothra / debug /
  • Timothy Lee J00220066
  • ITE 370 Ms. Chapman
  • Technical Presentation 04-10-07

2
What is a bug?
Materials used in this presentation may be
downloaded from acm . southalabama . edu /
Mothra / debug /
  • A fault occurs when a human makes an error.
  • A failure is any departure from a systems
    required behavior.

From Software Engineering, 3rd Edition, by Shari
Lawrence Pfleeger and Joanne Atlee, 2006 Pearson
Education Inc., Upper Saddle River, NJ
3
Types of Errors
Materials used in this presentation may be
downloaded from acm . southalabama . edu /
Mothra / debug /
  • Syntax Errors-any error that prevents the
    program from compiling and executing.
  • Execution Errors-any statement that attempts to
    perform an illegal operation.
  • Logic Errors-any statement that executes
    successfully, but doesnt perform as expected,
    usually due to a human computational error.

4
Breakpoints
  • Continue
  • Break (pause execution)
  • Stop Debugging (quit execution)
  • Restart
  • Show Next Statement
  • Step Into
  • Step Over
  • Step Out

5
Breakpoints (continued)
  • SHORTCUT KEYS
  • Start/Continue F5
  • Stop ShiftF5
  • Restart CtrlShiftF5
  • Step Into F11
  • Step Over F10
  • Step Out ShiftF11

6
Customizing Breakpoints
  • Conditions only break if condition is true
  • Hit Count times a breakpoint has been
    reached can set to stop breaking after a
    certain count
  • Tracepoints print string when breakpoint is
    reached
  • option to not break when breakpoint reached
  • Run To Cursor execute program and break at
    cursor position

7
Managing Breakpoints
  • Disable/Enable All Breakpoints(Debug main menu)
  • Breakpoints Window
  • (Debug main menu -gt Windows -gt Breakpoints)
  • - allows user to view all Breakpoints an a
    program, jump to their code, edit their
    properties, enable/disable and delete.

8
Call Stack
  • Displays all currently executing procedures in
    the order that they have been called.
  • Will link you to specific procedures.

9
Immediate Window
  • View current variablesType ?
    variableNames
  • Change variables valuestype varialbeName
    value

10
Calls to the Debug Class
  • There exists a System.Diagnostics.Debug Class.
    With multiple tools available to aid debugging.
  • Debug.Assert(condition, message, detailed
    message)create custom error messages that
    display only when a condition is true.
  • Debug.WriteLine(message)alternative to
    Console.WriteLine( )
  • When you compile your program as a release build,
    these objects are disabled, saving you the time
    of going through and removing Console.PrintLine
    statements.

Explore additional members of Debug
at http//msdn2.microsoft.com/en-us/library/syst
em.diagnostics.debug_members.aspx
11
Visualizations
  • Autos Window
  • shows variables used by the current and previous
    statements.
  • Locals Windowshows all of the variables in the
    current scope
  • Quick Watch Watch Windowshows only variables
    you attach to a Watch Window
  • Windows display the name, value, and type of
    variables. Gives you the ability to manually
    change values using a visual interface rather
    than typing text commands.

12
Data Visualizers
  • When a program is paused, hovering the cursor
    over a variables will display its value.
  • For complex datatypes, you can view either a
    text, html, or xml Visualizer presenting an
    organized view of the data.
Write a Comment
User Comments (0)
About PowerShow.com