sigsuspend() and ptrace()

From: Greg
Date: Fri Nov 04 2005 - 03:57:44 EST


Hi,

My program uses gdb to attach to a process and make it execute a specific
function thanks to the gdb 'call' command. This works quite well unless the
attached process is sleeping in sigsuspend(). I peeked into the kernel sources
and saw that the typical sigsuspend() implementation is like this :

while (1) {
schedule();
if (do_signal())
return -EINTR;
}

When using ptrace attach, the target process receives a SIGSTOP but there
isn't *of course* any handler to SIGSTOP. And no way for the process to return
to userland... is it implemented that way on purpose ? How can I make suspending
processes do some *alternative* work with gdb ?

Thanks.

Greg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/