This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Fix register cache invalidation
- From: Pedro Alves <pedro at codesourcery dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 20 Jul 2009 14:35:07 +0100
- Subject: Re: [rfc] Fix register cache invalidation
- References: <200907141459.n6EExSxC004676@d12av02.megacenter.de.ibm.com>
On Tuesday 14 July 2009 15:59:28, Ulrich Weigand wrote:
> when testing the Cell/B.E. combined debugger patches I ran into a situation
> where registers_changed was not called soon enough.
>
> A while ago I proposed a patch to simplify register invalidation (as part of
> a infrun cleanup series):
> http://sourceware.org/ml/gdb-patches/2008-12/msg00120.html
> This cleanup actually fixes the combined debugger problem as well.
Curious. Are we sure we're not hidding some other bug then?
> At the time, Pedro pointed out that parts of that patch weren't safe in the
> non-stop case. The version below omits those parts, and only changes code
> to simplify calling registers_changed and resetting waiton_ptid.
> Tested on powerpc64-linux with no regressions.
> Any comments? I'd like to commit this in a couple of days.
I like it!
> > (fetch_inferior_event): Remove check for always-true condition.
>
> - /* We can only rely on wait_for_more being correct before handling
> - the event in all-stop, but previous_inferior_ptid isn't used in
> - non-stop. */
> - if (!ecs->wait_some_more)
> - /* We'll update this if & when we switch to a new thread. */
> - previous_inferior_ptid = inferior_ptid;
> + /* We'll update this if & when we switch to a new thread. */
> + previous_inferior_ptid = inferior_ptid;
This is actually a bug in the async/all-stop (you're not introducing
it, it's already there). We shouldn't be clobbering previous_inferior_ptid
on every internaly handled event. Just noting it --- don't worry about it.
--
Pedro Alves