From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Do not call read_pc in startup_inferior
Date: Wed, 29 Apr 2009 12:33:00 -0000 [thread overview]
Message-ID: <200904291232.n3TCWuSw015927@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20090428192826.GA31724@caradoc.them.org> from "Daniel Jacobowitz" at Apr 28, 2009 03:28:26 PM
Daniel Jacobowitz wrote:
> On Tue, Apr 28, 2009 at 06:37:12PM +0200, Ulrich Weigand wrote:
> > Hello,
> >
> > a while ago, I committed a patch to avoid calling wait_for_inferior
> > in startup_inferior, so as to avoid accessing inferior register state
> > at a time where the target's actual register layout has not yet been
> > determined (via target_find_description).
> >
> > However, startup_inferior still contains a read_pc call to retrieve
> > the initial value of stop_pc -- this of course runs into the same
> > problem.
> >
> > The patch below removes the read_pc call from startup_inferior, and
> > instead determines the initial stop_pc value in post_create_inferior,
> > after the register layout has been finalized.
>
> You're moving the call from a native "run" only routine, to an
> all-targets routine. That made me curious so I went looking... what
> relies on this setting? Anything?
It doesn't seem a lot relies on it; the solib_create_inferior_hook
might, but this is the case only for solib-sunos.c (which I guess
could be changed to use regcache_read_pc).
The only other potentially user-visible change seems to be that
"info program" will report "Program stopped at ..." giving the
proper entry point address.
In any case, most create_inferior implementations either call
startup_inferior, or otherwise set stop_pc e.g. by calling into
wait_for_inferior (in the latter case it shouldn't hurt to set
it again).
There are some targets that currently do not appear to set stop_pc:
the remote-extended mode, NTO, and some monitor targets. These
would see a difference in "info program" output due to my patch
(but the new behaviour should be preferable, I guess) ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2009-04-29 12:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 16:37 Ulrich Weigand
2009-04-28 19:28 ` Daniel Jacobowitz
2009-04-29 12:33 ` Ulrich Weigand [this message]
2009-04-29 13:07 ` Pedro Alves
2009-04-30 14:27 ` Ulrich Weigand
2009-04-30 15:55 ` Pedro Alves
2009-05-04 17:40 ` Ulrich Weigand
2009-05-05 21:43 ` Pedro Alves
2009-05-05 13:28 ` Ulrich Weigand
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=200904291232.n3TCWuSw015927@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=drow@false.org \
--cc=gdb-patches@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