Debugging in C: An Introduction to Tools and Techniques**
This document provides an introduction to the importance of debugging in C programming, emphasizing the potential and features of debuggers. It discusses how debugging allows programmers to monitor variable values in real-time, and compares various debugger options, including Visual Studio and GNU Debugger. The content includes practical debugging techniques such as setting breakpoints, single stepping, and analyzing the call stack, with examples demonstrating these concepts in the Eclipse IDE and insights on pointer representation in 32-bit operating systems.
Debugging in C: An Introduction to Tools and Techniques**
E N D
Presentation Transcript
SBE201 – Data Structures and Algorithms in C Intro to Debugging Marwan H. Hussein, TA B.Sc., Systems & Biomedical Engineering Department, Cairo University Egypt
Contents • Potential of debugging • Features of a typical debugger
Potential of debugging • Imagine there’s a big code that you want to know many intermediate values of its variables while its running.. • You can use printf() several time, but this is going to be time consuming
A Debugger • A debugger is a program (separate from the compiler & linker) that allows you to run your binaries while giving you the ability of a ProgramCntr!! • Like compilers, many debuggers exist: • VS debugger • GNU debugger (what we gonna use open source)
Abilities of a debugger • Continuous running • But stopping @ breakpoints • Single stepping • Step over • Step into • Step out • Function call stack • Several other things (advanced) Let’s see this in Eclipse
drills • For pointers on 32-bit OS • Why pointer values appear in 8 numbers? • For call stack What you think this is ??