Learn how debuggers work by building your own one
summary
A tiny debugger is built in Go that actually works: it launches a traced child on Linux, uses ptrace peek/poke to write an 0xCC breakpoint and restore original bytes, implements continue, single-step, PtraceGetRegs/SetRegs to read and move the PC, and parses DWARF and symbol tables to map source lines to program counters. Step-in/step-out/step-over are implemented by inserting and clearing breakpoints at call and return addresses. Variable inspection remains unfinished.
AI-written summary · about
chapters (19)
- 0:00Building a debugger
- 1:08Talk audience and speaker
- 3:35Debugger basics with Go
- 6:24Debugger features and optimizations
- 8:32Program counter and registers
- 9:14DWARF format
- 10:19PTrace system calls
- 13:27Tracing child process
- 15:58Step through instructions
- 17:26Symbol tables and lookup
- 19:57Breakpoints insertion/removal
- 25:54Step in/out/over
- 27:00Smallugger project
- 34:08Debugging with step commands
- 36:16Debugger architecture
- 38:03Variable inspection and improvements
- 39:11Delve features
- 40:14Debugger development reading
- 41:40Q&A
related talks
17mDebuggers from scratch
43mDebugging Code Generation in Go
50mDeterministic debugging with Delve
31mDebugging Go: from zero to Kubernetes - Michele Caci
40mDebugging in Golang Apps Inside K8s Environment
40mDebugging concurrency programs in Go
28mHow to Win Frames and Influence Pointers
53mDebugging Go Applications
