Writing a Debugger from Scratch