From: Michael Snyder <msnyder@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Michael Snyder <michsnyd@cisco.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Linux Checkpoint/Restart, take 2 (footnote)
Date: Sat, 24 Dec 2005 16:15:00 -0000 [thread overview]
Message-ID: <43AC7183.2080406@redhat.com> (raw)
In-Reply-To: <20051223142940.GA24997@nevyn.them.org>
Daniel Jacobowitz wrote:
> I totally don't understand what the clobber_regs bits are for. You're
> using fork as a backend; each saved fork had better have both its own
> registers, right? Is it just a GDB internal bookkeeping thing? If so,
> why do you need to do it for saved forks and not for the existing
> follow-fork bits?
OK, here's the thing. If we switch contexts to a fork that was
actually created by the user process, we actually don't need the
saved copy of the regcache -- we can simply allow gdb to fetch
the regs from the "new" inferior_ptid.
But if we do that for a checkpoint fork, it's not gonna work,
because when THAT process was created, it was in a function
(fork) that was called by gdb. So its register state and stack
are in the state as set up by Call-Function-By-Hand. In other
words, when it was "frozen", it was before returning to CFBH,
and therefore CFBH had not yet had a chance to restore the
pre-CFBH register state.
So we have to do that now. It's just a bit of post-cleanup
from after the CFBH state, and we don't in fact want to do it
for the "natural" forks, because if we did, we would be restoring
the register state of the parent, not the child, and that would
(usually) include the return value of fork. Not good.
In the case of the gdb-created forks, we actually *want* to
restore the parent's register state. Hence the difference.
Clear now? ;-)
Michael
next prev parent reply other threads:[~2005-12-23 21:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-22 4:05 [RFA] Linux Checkpoint/Restart, take 2 Michael Snyder
2005-12-22 13:20 ` Eli Zaretskii
2005-12-22 14:09 ` Michael Snyder
2005-12-22 14:20 ` Eli Zaretskii
2005-12-26 14:49 ` [commit] Fix "eg." and "e.g." in the docs (was: [RFA] Linux Checkpoint/Restart, take 2) Eli Zaretskii
2005-12-26 15:34 ` [commit] Fix usage of "etc." " Eli Zaretskii
2005-12-23 21:52 ` [RFA] Linux Checkpoint/Restart, take 2 Michael Snyder
2005-12-23 22:00 ` Eli Zaretskii
2005-12-23 22:42 ` Daniel Jacobowitz
2005-12-24 15:25 ` Michael Snyder
2005-12-24 15:30 ` Daniel Jacobowitz
2005-12-24 16:15 ` Michael Snyder [this message]
2005-12-24 16:31 ` [RFA] Linux Checkpoint/Restart, take 2 (footnote) Daniel Jacobowitz
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=43AC7183.2080406@redhat.com \
--to=msnyder@redhat.com \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=michsnyd@cisco.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