1/13
Flashcards covering key concepts in debugging, including types of bugs, debugging strategies, and tools like GDB.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What flexibility does preprocessing offer?
Replacing identifiers with definitions, including header files, controlling compilation, and diagnosing problems.
What is debugging?
A methodical process of finding and reducing the number of bugs, or defects, in a computer program.
What was the first 'bug'?
A moth trapped in a relay of the Harvard Mark II computer in 1947.
What are the two main types of bugs?
Bugs that occur during compilation time (syntax errors, violations of conventions) and bugs that occur during run time (logical errors).
Explain the 'divide and conquer' debugging strategy.
Gradually remove/add code to create the smallest source file that contains the bug. Remove code until the program works well, or add functionality until the program breaks.
What is debugging using logging?
Inserting printf statements in different places of the code to follow its flow.
What are the potential issues with using printf for debugging?
Inclusion of printf could change the behavior of the code (timing, stack), and the code may fail when printf is removed (Heisenbug).
What is a serial/UART interface?
A communication interface between two computers that transmits information sequentially, one bit at a time.
What does a debugger allow you to do?
Stepping through a program, setting breakpoints, investigating machine state, and investigating crashes.
What are some considerations regarding debuggers?
Language-dependent, may require hardware support, and may provide different interfaces (command line or GUI).
What is the GNU Debugger (GDB)?
An open-source debugger developed by the GNU project, designed for the C language, with a command line interface.
What are debug symbols?
Records associating code and variables with source code; generated by the compiler flag –g.
What is Little Endian?
The Least Significant Byte (LSB) is stored first.
What is DAPLink?
An On-Chip Debugger that allows remote debugging, often integrated with VS Code.