From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12428 invoked by alias); 8 Aug 2012 17:54:04 -0000 Received: (qmail 12420 invoked by uid 22791); 8 Aug 2012 17:54:03 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Aug 2012 17:53:49 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q78HrgBo005691; Wed, 8 Aug 2012 19:53:42 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q78Hre36003861; Wed, 8 Aug 2012 19:53:40 +0200 (CEST) Date: Wed, 08 Aug 2012 17:54:00 -0000 Message-Id: <201208081753.q78Hre36003861@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: yao@codesourcery.com CC: gdb-patches@sourceware.org In-reply-to: <1343891847-16554-1-git-send-email-yao@codesourcery.com> (message from Yao Qi on Thu, 2 Aug 2012 15:17:27 +0800) Subject: Re: [PATCH] Don't attach to 'target_changed' observer in regcache References: <1343891847-16554-1-git-send-email-yao@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00261.txt.bz2 > From: Yao Qi > Date: Thu, 2 Aug 2012 15:17:27 +0800 > > Hi, > When I am modifying 'target_changed' observer, I don't understand > why we attach regcache_observer_target_changed to 'target_changed' > observer, and invalidates all regcache. 'target_changed' observer > is notified in valops.c:value_assign, before that, register is > modified by calling either gdbarch_value_to_register or > put_frame_register_bytes. Looks like regcache is in a good state, > why do we have to invalidate them? > > The code that invalidates all regcache was added by this patch, > > Multiplexed registers and invalidating the register cache > http://sourceware.org/ml/gdb-patches/2004-04/msg00282.html > > The author (Orjan) tried to support "changing the bank select register > changes the contents (and meaning) for a whole set of other registers." > The requirement is quite specific to Orjan's own port, so the better > solution is to attach a function which invalidates all regcache in > Orjan's backend, instead of doing it in target-independent part. Banked registers aren't really that exotic. Especially if you realise that register windows (SPARC, IA-64) are essentially banked registers. I fear you're trading speed for correctness here. > > 2012-08-02 Yao Qi > > * regcache.c (regcache_observer_target_changed): Remove. > (_initialize_regcache): Don't call observer_attach_target_changed.