This is a fantastic summary of debugger implementation!<p>Another great one that actually walks through writing a basic debugger is Eli Bendersky's series[1].<p>One nitpick:<p>> It could, and that would work (that the way valgrind memory debugger works), but that would be too slow. Valgrind slows the application 1000x down, GDB doesn't. That's also the way virtual machines like Qemu work.<p>This is usecase-dependent: running a program until you hit a breakpoint will be significantly faster with `int 3`, but running a piece of instrumentation on every instruction (or branch, or basic block, or ...) will be significantly faster with Valgrind (or another dynamic binary instrumentation framework). This is because Valgrind and other DBI tools can rewrite the instruction stream to sidecar instrumentation into the same process, versus converting every instruction (or other program feature) into a sequence of expensive system calls.<p>[1]: <a href="https://eli.thegreenplace.net/tag/debuggers" rel="nofollow">https://eli.thegreenplace.net/tag/debuggers</a>