From: Yao Qi <yao@codesourcery.com>
To: "Breazeal, Don" <donb@codesourcery.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Why aren't inferiors deleted on exit or detach
Date: Wed, 07 May 2014 05:46:00 -0000 [thread overview]
Message-ID: <5369C841.7090001@codesourcery.com> (raw)
In-Reply-To: <53694328.30907@codesourcery.com>
On 05/07/2014 04:16 AM, Breazeal, Don wrote:
> I've been struggling with the issue of when to delete inferiors, as I'm
> working on remote follow-fork. It looks like inferiors are kept around
> after a process exits or is detached or killed so that the user can
> switch to the inferior and run it again. The argument vector for the
> inferior is kept intact on exit/detach/etc.
>
> Is my understanding here correct?
Yes, I think so.
https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-and-Programs.html
mentions that "Inferiors may be created before a process runs, and may
be retained after a process exits." and "After the successful completion
of a command such as detach, detach inferiors, kill or kill inferiors,
or after a normal process exit, the inferior is still valid and listed
with info inferiors, ready to be restarted."
>
> With "follow-fork parent" and "detach-on-fork on", GDB does *not* keep
> an inferior around for the detached child. My guess is that this is
> because the child inferior would just be a duplicate of the parent inferior.
>
> Correct?
I am not the people write this part of code, but afaik, GDB doesn't add
inferior into its table in this case, because these two options setting
mean after a fork, the original process is debugged and child process
will be detached, so GDB doesn't have to save child process in its
inferior table.
--
Yao (é½å°§)
prev parent reply other threads:[~2014-05-07 5:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 20:16 Breazeal, Don
2014-05-07 5:46 ` Yao Qi [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=5369C841.7090001@codesourcery.com \
--to=yao@codesourcery.com \
--cc=donb@codesourcery.com \
--cc=gdb@sourceware.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