Live data from Hacker News

How Debuggers Work: Getting and Setting x86 Registers

moritz.systems

11–13 of 13 posts

Re: How Debuggers Work: Getting and Setting x86 Registers

#11
post #4

Earlier quoted context omitted.

The least annoying thing about writing and working with Linux debuggers is that all of the communication layers (kernel debugger, debugger C library, debugger loader, debugger compiler [1]) is basically undocumented. I mean, it's annoying trying to track down where in the source code these things exist, but if you have experience working in large codebases, this kind of task is needed sufficiently frequently that it'…

man 2 ptrace is really one of the worst man pages in existence, and it's made doubly bad because there are only two real clients that you can reference, one of which is pretty much the definition of an awful legacy codebase and the other which is over- and strangely-engineered and at times not even correct or complete. Actually, triply bad because ptrace(2) itself is the worst API and it bleeds into some other fairly…

I obviously don't know the details of what you were doing but it's generally easier to implement the gdbserver protocol than to implement ptrace itself.
Post reply on HN