On Wed, Nov 23, 2016 at 10:03 PM, Brent W. Baccala <cosine@freesoft.org> wrote:
Any comments?
Well, yes, actually. :-)
gdb's hurd target has a poorly documented command "set noninvasive". I don't completely understand it, but...
I'm starting to see the rational for an "invasive" debugging mode. "Invasive" means that we debug by wrapping Mach ports - the task port needs to be wrapped along with the exception ports. "Non-invasive" means that we rely on the C library in the program under test to provide some debugging support. No port wrapping is done. Breakpoints, for example, work by letting the program's message thread generate a SIGTRAP, which gets relayed to the proc server and is presented to the debugger in response to a wait() call.
Non-invasive is more efficient, but invasive is more reliable.
I'd code it myself, except that we've got the same old problem with detaching a process when its ports are wrapped. This shows, incidentally, that adding a system call trace facility to the kernel isn't a complete solution. We don't just want to trace these messages - we want to intercept them and only deliver them after a human being has had the chance to inspect them at a debugger prompt.