public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg <gkurz@fr.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: sigsuspend() and ptrace()
Date: Fri, 04 Nov 2005 09:57:49 +0100	[thread overview]
Message-ID: <436B228D.2000309@fr.ibm.com> (raw)

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.


             reply	other threads:[~2005-11-04  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04  8:57 Greg [this message]
2005-11-19  4:22 ` sigsuspend() and ptrace() Daniel Jacobowitz
2005-11-23 20:23   ` Greg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=436B228D.2000309@fr.ibm.com \
    --to=gkurz@fr.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox