From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4032 invoked by alias); 24 Apr 2004 00:03:09 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3883 invoked from network); 24 Apr 2004 00:03:06 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 24 Apr 2004 00:03:06 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3O036KG001545 for ; Fri, 23 Apr 2004 20:03:06 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3O036p30963 for ; Fri, 23 Apr 2004 20:03:06 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EB7752BA2; Fri, 23 Apr 2004 10:27:27 -0400 (EDT) Message-ID: <408927CF.10807@gnu.org> Date: Sat, 24 Apr 2004 00:03:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Orjan Friberg Cc: gdb-patches@sources.redhat.com Subject: Re: Multiplexed registers and invalidating the register cache References: <407D242B.109@axis.com> <20040414144607.GA5700@nevyn.them.org> <407E67EA.80701@axis.com> <407E70FD.7060709@axis.com> <407EAA4B.7000500@gnu.org> <407FD693.2080804@axis.com> <408030DB.3080708@gnu.org> <4083DE9C.7000208@axis.com> <40869FC4.2090407@gnu.org> <4087CF61.4030109@axis.com> <4087D794.10209@gnu.org> <4088FD0F.7050501@axis.com> In-Reply-To: <4088FD0F.7050501@axis.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00591.txt.bz2 Yes, on all counts! > Andrew Cagney wrote: > >> >> Oops, yes, pass the current_target (I ment that it shouldn't have a parameter trying to tell the observers anything beyond the fact that the target has changed). (the sed script generates () instead of (void)). > > > Ok. > >> There are architectures where registers live in memory so the information is simply misleading. > > > Ok, I'm convinced. (Thanks for clarifying.) > >> Eventually, yes. The two can co-habitate for a bit, first just: >> >> - add the observer > > > Ok. observer.texi gets the following lines added: > > @deftypefun void target_changed (struct target_ops *@var{current_target}) > The target's register contents has changed. > @end deftypefun > > (Proper patch delayed until I've got all the pieces in place.) > >> - add code to frame.c and regcache.c to register themselves > > > I'm sorry; this is the part I don't get - my skull must be getting really thick. Are you saying that frame.c and regcache.c should register an observer each for the target_changed event, like this (frame.c): > > void > frame_observer_target_changed (struct target_ops *current_target) > { > flush_cached_frames (); > } > observer_attach_target_changed (frame_observer_target_changed); > > and (regcache.c): > > void > regcache_observer_target_changed (struct target_ops *current_target) > { > registers_changed (); > } > observer_attach_target_changed (regcache_observer_target_changed); > >> - add code to the problem area to trigger the observer > > > Ok; something like (example from valops.c): > > if (deprecated_register_changed_hook) > deprecated_register_changed_hook (-1); > target_changed_event (); > + observer_notify_target_changed (current_target); > break; > } > > -- > Orjan Friberg > Axis Communications > >