1 / 7

Debugging

Debugging. Xin Tong. GDB. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing statement) Four main kinds of things: Start your program, specifying anything that might affect its behavior.

anila
Télécharger la présentation

Debugging

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Debugging Xin Tong

  2. GDB • GDB • GNU Project debugger • Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing statement) • Four main kinds of things: • Start your program, specifying anything that might affect its behavior. • Make your program stop on specified conditions. • Examine what has happened, when your program has stopped. • Change things in your program • Ada, C, C++, Objective-C, Pascal (and many other languages).  Reference: http://beej.us/guide/bggdb/ http://www.gnu.org/software/gdb/

  3. Visual Studio as Example • An integrated development environment (IDE) from Microsoft. • Supports different programming languages, such as C, C++, VB.NET, C#, and F#.

  4. Breakpoints • Debugging with Breakpoints • Step Over • Step Into • Step Out • Continue • Set Next Statement • Show Next Statement • Run to cursor • Labeling in Break Point • Conditional Breakpoint • Breakpoint Hit Count • Breakpoint When Hit Reference: http://www.codeproject.com/Articles/79508/Mastering-Debugging-in-Visual-Studio-A-Beginn

  5. Data Tip • Pin Inspect Value During Debugging • Drag-Drop Pin Data Tip • Adding Comments • Import Export Data Tips • Change Value Using Data Tips • Inspect containers • Clear Data Tips

  6. Debug Windows • Watch Windows • Locals • Autos • return value from last statement • File base address • Watch • Memory Window • Immediate Window • Call Stack

  7. Example Bugs • Array index out of bounds • Uninitialized variable Reference: http://www.klocwork.com/blog/nasty-bugs/top-5-cc-quality-bugs/

More Related