Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Kevin Pouget <kevin.pouget@gmail.com>
Subject: Re: Follow-fork-mode and inferiors
Date: Wed, 01 Jun 2011 15:29:00 -0000	[thread overview]
Message-ID: <201106011629.18877.pedro@codesourcery.com> (raw)
In-Reply-To: <BANLkTin1PTQ5vuO5h+eoAzkRgym0HCfCmw@mail.gmail.com>

On Wednesday 13 April 2011 14:33:01, Kevin Pouget wrote:
> Hello,
> 
> I noticed a behavior which appears strange to me, I would like to know
> if it was expected:
> 
> > (gdb) list
> > 1    int main() {
> > 2        fork() ;
> > 3    }
> >
> > (gdb) break 3
> > (gdb) set follow-fork-mode child
> > (gdb) run
> > ...
> > Breakpoint 1, main () at fork.c:3
> > 3    }
> > (gdb) info inferiors
> >   Num  Description       Executable
> > * 2    process 26039     /home/kevin/travail/arm/perso/root/sample/fork-threads/fork
> >   1    <null>            /home/kevin/travail/arm/perso/root/sample/fork-threads/fork
> 
> why are there two inferiors? I expected either to stay in inf 1 (if
> the pid of an inferior can change) or inf 1 to disappear, but not to
> keep both of them!

Hmm, if detach-on-fork is on (the default), yeah.
I'd argue for staying in inf 1.  linux-nat.c:linux_child_follow_fork
is the place to look.  The problem is the vfork case, and
what to do with the vfork parent.

-- 
Pedro Alves


  parent reply	other threads:[~2011-06-01 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTikpEhjP-RPyLFcwoF=nC3K+oas-ZQ@mail.gmail.com>
2011-04-13 13:33 ` Kevin Pouget
2011-04-13 14:29   ` Tom Tromey
2011-04-13 14:50     ` Kevin Pouget
2011-06-01 15:29   ` Pedro Alves [this message]
2011-06-01 15:51     ` GDB Darwin James Boulton
2011-06-01 16:22       ` Joel Brobecker
2011-06-02 13:03         ` James Boulton
2011-06-06 21:28           ` Thiago Jung Bauermann

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=201106011629.18877.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=kevin.pouget@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