How Debuggers Work
summary
Breakpoints work by mapping source lines to machine addresses via DWARF line tables and then stopping the process either by writing an 0xCC int3 software breakpoint into the running code or by programming one of the four hardware debug registers (read/write/execute) with prace calls on x64 Linux. Stack unwinding uses DWARF CFI tables, expression evaluation sets registers/stack per the System V ABI to call functions in-process, and shared libraries notify debuggers via the debug rendezvous link map.
AI-written summary · about
chapters (11)
- 0:00Debuggers introduction
- 1:27Debug architecture components
- 5:02Breakpoints under the hood
- 14:05Watch points and hardware breakpoints
- 18:02Stepping code levels
- 21:12Stack unwinding and call frames
- 27:59Reading variables and memory
- 31:12Calling functions in process
- 39:01Debugging shared libraries
- 44:27Debugging embedded JTAG
- 57:04Q&A
related talks
01h 01mBack to Basics: Debugging in C++
01h 02mNext Generation Debugging
41mDemistifying Rust Debugging
33mBeyond println!: Mastering Rust Debugging
05mSolving a bug via lateral thinking
45mFreaking computers, how do they work?
14mIntroduction to Undodb
59mAsync Stacks: Making Senders and Coroutines Debuggable
