Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: Follow-fork-mode and inferiors
Date: Wed, 13 Apr 2011 14:50:00 -0000	[thread overview]
Message-ID: <BANLkTimYgBM9-s+HMs3crAQuqAaebqNpwQ@mail.gmail.com> (raw)
In-Reply-To: <m3wriy1axz.fsf@fleche.redhat.com>

oh, I didn't now this  `follow-exec-mode' setting, which explains why
we might want to create a new inferior

but (as the name suggests) it's not involved when the inferior forks,
and GDB behaves as if it were set to 'new'. Unfortunately,
`follow-fork-mode' is already used to follow the child or the parent
...



Kevin
--

(gdb) help set follow-exec-mode
Set debugger response to a program call of exec.
An exec call replaces the program image of a process.

follow-exec-mode can be:

  new - the debugger creates a new inferior and rebinds the process
to this new inferior.  The program the process was running before
the exec call can be restarted afterwards by restarting the original
inferior.

  same - the debugger keeps the process bound to the same inferior.
The new executable image replaces the previous executable loaded in
the inferior.  Restarting the inferior after the exec call restarts
the executable the process was running after the exec call.

By default, the debugger will use the same inferior.

(gdb) help set follow-fork-mode
Set debugger response to a program call of fork or vfork.
A fork or vfork creates a new process.  follow-fork-mode can be:
  parent  - the original process is debugged after a fork
  child   - the new process is debugged after a fork
The unfollowed process will continue to run.
By default, the debugger will follow the parent process.

On Wed, Apr 13, 2011 at 10:29 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
>
> Kevin> why are there two inferiors? I expected either to stay in inf 1
> Kevin> (if the pid of an inferior can change) or inf 1 to disappear, but
> Kevin> not to keep both of them!
>
> I suspect that it may be due to your `follow-exec-mode' setting.
> I am not really certain though.
>
> Tom
>


  reply	other threads:[~2011-04-13 14:50 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 [this message]
2011-06-01 15:29   ` Pedro Alves
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=BANLkTimYgBM9-s+HMs3crAQuqAaebqNpwQ@mail.gmail.com \
    --to=kevin.pouget@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=tromey@redhat.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