Debuggers from scratch
summary
Builds a working debugger in a few lines of Go that maps Go source lines to machine addresses, uses ptrace and the syscall poke to overwrite the first instruction byte with 0xCC breakpoint, and resumes the process to stop exactly at the intended source line. It extracts registers (instruction pointer, stack pointer, base pointer), walks stack frames to produce a trace, and admits the code overwrites that original byte without restoring it. The prototype runs and produces a trace in about fifteen minutes.
AI-written summary · about
chapters (5)
related talks
42mLearn how debuggers work by building your own one
43mDebugging Code Generation in Go
50mDeterministic debugging with Delve
28mHow to Win Frames and Influence Pointers
10mBacktraces in the mirror: mad science by secrets of elves & dwarves!!
54mTracing Go Programs with eBPF!
48mDPTrace: Dual Purpose Trace for Exploitability Analysis of Program Crashes
01h 26mDebug C++ Code - Best Time Travel Debugging Tech
