170 likes | 370 Vues
Debugging. Louis Lombardi Marc Cunningham Padraic DeVincentis. What is it?. Debugging is a method of finding defects within code source Usually consists of looking at source code Comparing it to some coding standards Evaluating logic behind it Checking for syntax errors.
E N D
Debugging Louis Lombardi Marc Cunningham PadraicDeVincentis
What is it? • Debugging is a method of finding defects within code source • Usually consists of looking at source code • Comparing it to some coding standards • Evaluating logic behind it • Checking for syntax errors
Why is it needed? • Ensures that source code is operational • Typically 4 types of coding errors: • Syntax error • Semantic error • Logical error • Environment error • Helps primarily to discover 4 types of coding errors • Solves the issue of manually viewing code (reduces time)
Most popular products? • GDB (GNU Debugger) • Firebug • WinDBG+ • Microsoft Visual Studio Debugger • PDB
GDB (GNU Debugger) • Source: • http://www.gnu.org/software/gdb/ • History: • Richard Stallman wrote it in 1986 for the GNU project • Written after the EMACs (GNU project’s editor) was completed • Modeled after Berkley’s Unix DBX debugger • Now it is maintained by Stallman’s Free Software Foundation • Padraic Demo:
GNU Debugger (GDB) • Symbolic debugger • Built for UNIX-like operating systems • Originally written by Richard Stallman • Maintained by open source community • Works for C, C++, FreeBASIC, FreePascal, and Fortran
GDB & Calculator Program (4) Original get_user_num Updated get_user_num
GDB & Calculator Program (6) • Backtracing (gdb command backtrace or bt) • Provides a view into the stack’s frames • Each numbered item is a “stack frame” in the CPU’s stack • Allows you to jump between stack frames when debugging • Useful for tracking down odd behavior in variables passed around by reference in complex data structures
FireBug (Firefox Extension) • Source: • http://getfirebug.com/ • History: • First release was available January 12, 2006 (v0.2) by Mozilla • Current version was released on May 6, 2010; it is version 1.5.4 • Written by Joe Hewitt, John J Barton, Jan Odvarko, Robcee and Firebug Working Group • Marc Demo:
Use with FOSS? • Used to enhance productivity of developers when writing code • Enables developers to test if code will compile before actually compiling • Allows developers to pause code execution at run-time to inspect data when troubleshooting code • All FOSS development projects use some form of a debugger to write the code for their project
References: • http://www.gnu.org/software/gdb/ • http://getfirebug.com/ • http://www.gnu.org/software/gdb/committee/ • http://getfirebug.com/wiki/index.php/Main_Page • http://www.devarticles.com/c/a/HTML/Combating-Coding-Errors/1/