Although none of these two commands is part of OpenSolaris, it's more of a 
question for general debugger tool I guess.

On AIX, dbx command (comes with the base OS) uses SIGTRAP signal to attach 
to a running process.
Looking at the gdb AIX specific source (./gdb/aix-thread.c), it appears to 
use SIGTRAP also:

/* Search through the list of all kernel threads for the thread
that has stopped on a SIGTRAP signal, and return its TID.
Return 0 if none found. */

One issue we found is that when we dbx or gdb attach to the a process with 
one of its threads waiting on select() call,
the select() will be interrupted and returns -1 with errno set to EINTR.
I don't (yet) think this is an unexpected behaviour in itself, since EINTR 
is a legitimate errno when select() is interrupted by a signal.

However this happens only on AIX and the reason (I think) might be that 
dbx/gdb on other *nix doesn't use signal.

How does the debuggers attach to running process in Solaris? 
Through some interface of procfs? (which seems to be the case in gdb source 
: ./gdb/sol-thread.c ).
Maybe I can find more information in mdb doc/source?

Thanks,
Tao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.opensolaris.org/pipermail/observability-discuss/attachments/20050708/2780ef81/attachment.html>

Reply via email to