Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Lukasz Lempart <llempart@gmail.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: gdb and cloned process
Date: Thu, 23 Oct 2008 20:01:00 -0000	[thread overview]
Message-ID: <4900D6CA.5090500@vmware.com> (raw)
In-Reply-To: <4ced24c0810221709u17575bf3s73994724c456e956@mail.gmail.com>

Lukasz Lempart wrote:
> I am using gdb 6.8 and running linux 2.6.9 on a 64bit AMD Opteron.
> 
> I am working with a multi-threaded application (using glibc's pthread
> implementation). One of the threads, clones another process using the
> following flags:
> 
> CLONE_VM | CLONE_UNTRACED | CLONE_DETACHED | CLONE_PARENT | CLONE_FILES
> 
> The cloned process also calls setsid creating its own process group.
> The idea here is to peek at the memory of the original application
> without stopping it, by attaching gdb to the cloned process.

I think your idea is interesting, but because of the intimate
relationship between linux clone and threads, the idea might not
be workable with multi-threaded programs.

Linux threads are built on top of clone.  It's hard to
separate them, and I'm not sure that we have ever really
tried to, since use of both in the same program is probably
quite rare.

The only suggestion I can think to offer is to build a
special gdb with threads disabled, and use that one to
view the clone.


      parent reply	other threads:[~2008-10-23 20:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23  0:10 Lukasz Lempart
2008-10-23  3:06 ` Daniel Jacobowitz
2008-10-23 17:14   ` Lukasz Lempart
2008-10-23 17:19     ` Daniel Jacobowitz
2008-10-23 18:31   ` Michael Snyder
2008-10-23 20:30     ` Lukasz Lempart
2008-10-23 21:44       ` Michael Snyder
2008-10-23 20:01 ` Michael Snyder [this message]

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=4900D6CA.5090500@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb@sourceware.org \
    --cc=llempart@gmail.com \
    /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