Instead I want to use the GDB protocol over an AF_GDB socket. It would use socket(AF_GDB, SOCK_STREAM, pid) to connect to the process to be debugged.
To do a run command in gdb, gdb will fork, connect to its child, request a message for "exec", and continue the child. When the child execs the program gdb will grab control of the new process and proceed from there.
As part of this effort, connecting to pid 0 would enable gdb access to the kernel (mostly as a tools to examine memory and threads; no breakpoints would be allowed).
Sounds pretty cool. I also despise procfs's complex interface. So, the while thing would be based on text-based messages or something? Hell, I suppose you could flat-out use the normal GDB remote protocol...
ReplyDelete