Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Debugging Xin Tong

2 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/7 9508/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/nast y-bugs/top-5-cc-quality-bugs/


Download ppt "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."

Similar presentations


Ads by Google