GDB - The GNU Debugger
Channel:
Subscribers:
2,640
Published on ● Video Link: https://www.youtube.com/watch?v=x_z1_5HaIyY
GDB is a great tpol to have in your toolchest. There's kind of three main ways of getting into it (compile with g++ -g main.cc):
1) If your program is crashing and core dumping: gdb a.out core
2) If your program is infinite looping: gdb a.out, then hit run, then while it's running in an infinite loop, hit ctrl-c and find out where it is
3) If your program is just giving bad output: gdb a.out, and then set a breakpoint on the area you're interested in (b 50 will set a breakpoint on line 50 for example), then run
When you're there, you can s to step into a line, n to step over, bt to backtrace, and print to print variables.
Other Videos By Bill Kerney
2022-03-28 | Automating the Boring stuff using UNIX Shell Scripting |
2022-03-28 | Deductive, Inductive, Abductive Reasoning |
2022-03-25 | Quadratic and Double Hashing |
2022-03-25 | Manufacturing Consent / Media Bias |
2022-03-23 | Fizzbuzz TDD Code Review, Makefiles Part II, Smart Pointers |
2022-03-23 | Analyzing Science Papers |
2022-03-21 | Hash Tables |
2022-03-21 | Algorithmic Bias / The Scientific Method |
2022-03-18 | C++ Sets/Maps/Unordered Sets/Unordered Maps, Chrono, GTest TDD |
2022-03-18 | Social Issues in Computer Science II: Race and Ethnicity |
2022-03-16 | GDB - The GNU Debugger |
2022-03-16 | Social Impact of Computer Science |
2022-03-16 | Linear Transformation Matrix Math |
2022-03-14 | Debugging |
2022-03-14 | Cognitive Biases Part III |
2022-03-11 | Templates + Rant on Template Substitution Errors |
2022-03-11 | Cognitive Biases II |
2022-03-09 | Deleting from a BST / Shell Scripting / Applying for a Job |
2022-03-09 | Privacy, Cognitive Biases I |
2022-03-09 | Radial Damage weapons |
2022-03-09 | Barycentric Coordinates + Z-Buffering |
Tags:
csci 41
gdb
debugging