linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: Rajesh Rajamani <raj@cs.wisc.edu>
Cc: linux-kernel@vger.kernel.org, zandy@cs.wisc.edu
Subject: Re: [PATCH] ptrace on stopped processes (2.4)
Date: Sun, 23 Mar 2003 23:09:08 -0500	[thread overview]
Message-ID: <20030324040908.GA19754@nevyn.them.org> (raw)
In-Reply-To: <1047936295.3e763d273307c@www-auth.cs.wisc.edu>

On Mon, Mar 17, 2003 at 03:24:55PM -0600, Rajesh Rajamani wrote:
> Hi All,
> I'm working on adding a function 
> 
> void debugbreak(void);
> 
> to glibc.  I got the inspiration for this from Windows.  Windows has a
> DebugBreak() function, which when invoked from  a process, spawns a
> debugger, which then attaches to the process.  I think this would be
> invaluable to linux developers in situations where they currently have to
> put an infinite loop and attach to a running process (say, to stop in a
> library that has been LD_PRELOADed).
> 
> To this end, I've been experimenting and found out that gdb can't attach
> to a process that has been stopped.  I'd like to send a SIGSTOP as soon as
> debugbreak() is invoked, so that all threads are stopped in a state close
> to the one they were in, when the debugbreak() was invoked. 
> 
> I spoke to Vic Zandy about this and he informed me that he had submitted a patch
>  that would allow ptrace to attach to stopped processes also (the thread of
> discussion is pasted below).  I believe the patch was not accepted at that time.
>    I was wondering what the official line on this is?  If there are no serious
> objections, will the community consider accepting the patch?  It would go a long
> way in helping me accomplish my goal.

The question is, what _should_ happen when yu attach to a stopped
process?  If the tracer receives the same one SIGSTOP that it normally
would, then it will just resume the program as if it weren't stopped. 
Does that make sense or not?

As for Vic's patch, the SIGSTOP leaving processes stopped bit is
already fixed in 2.5, I believe.  We need to decide what should happen
when attaching to a stopped process before that half can be considered.

(And the patch itself is wrong; send_sig is too broad a hammer for
this, it should probably be something more like force_sig_specific; but
I'm not sure that's the right approach.  I'll think about it.)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

  reply	other threads:[~2003-03-24  3:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17 21:24 [PATCH] ptrace on stopped processes (2.4) Rajesh Rajamani
2003-03-24  4:09 ` Daniel Jacobowitz [this message]
2003-03-24  6:24   ` raj
2003-03-24 15:05     ` Daniel Jacobowitz
2003-03-25 13:48       ` Werner Almesberger
2003-03-25 13:58         ` Daniel Jacobowitz
2003-03-25 14:53           ` Werner Almesberger
  -- strict thread matches above, loose matches on Subject: below --
2001-12-21 19:53 vic
2001-12-21 23:19 ` Jeff Dike
2001-12-22  3:56 ` OGAWA Hirofumi
2001-12-22 17:38 ` Mike Coleman
2002-01-17 16:57   ` vic
2002-01-17 19:23     ` OGAWA Hirofumi
2002-01-23 17:58       ` vic
2002-01-23 22:14         ` OGAWA Hirofumi
2002-01-23 22:29           ` vic
2002-01-24  1:41             ` OGAWA Hirofumi
2002-01-21  3:09     ` Mike Coleman
2002-01-28 20:15       ` vic
2002-03-19  3:59         ` vic

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=20030324040908.GA19754@nevyn.them.org \
    --to=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raj@cs.wisc.edu \
    --cc=zandy@cs.wisc.edu \
    /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;
as well as URLs for NNTP newsgroup(s).