From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26436 invoked by alias); 27 Apr 2005 15:40:35 -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 26140 invoked from network); 27 Apr 2005 15:40:18 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 27 Apr 2005 15:40:18 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DQoeA-00025H-Ck; Wed, 27 Apr 2005 11:40:18 -0400 Date: Wed, 27 Apr 2005 15:40:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] Eliminate use of deprecated_register_bytes() from remote.c Message-ID: <20050427154018.GB7765@nevyn.them.org> Mail-Followup-To: Kevin Buettner , gdb-patches@sources.redhat.com References: <20050415143245.4b210dfe@ironwood.lan> <20050415213758.GA13161@nevyn.them.org> <20050415161212.28c1d511@ironwood.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050415161212.28c1d511@ironwood.lan> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00357.txt.bz2 On Fri, Apr 15, 2005 at 04:12:12PM -0700, Kevin Buettner wrote: > On Fri, 15 Apr 2005 17:37:58 -0400 > Daniel Jacobowitz wrote: > > > On Fri, Apr 15, 2005 at 02:32:45PM -0700, Kevin Buettner wrote: > > > This one seems almost obvious, but I'd like someone else to look it > > > over before I check it in... > > > > > > * remote.c (init_remote_state): Eliminate use of > > > deprecated_register_bytes(). > > > > I'm pretty sure you need an if (regnum < NUM_REGS) on the second piece. > > I agree that that's the right thing to do, but I'm not convinced that > will give us behavior equivalent to what we have now. Consider the > following comment/code from regcache.c: > > /* FIXME: cagney/2002-05-22: Should only need to allocate space for > the raw registers. Unfortunately some code still accesses the > register array directly using the global registers[]. Until that > code has been purged, play safe and over allocating the register > buffer. Ulgh! */ > descr->sizeof_raw_registers = descr->sizeof_cooked_registers; > > The ``sizeof_raw_registers'' field is the value returned by > deprecated_register_bytes(). So, it seems to me that we're presently > setting rs->sizeof_g_packet to a value that's potentially larger than > need be. You are definitely right. That's an Ulgh indeed. > I can think of no reason to continue to over-allocate space for g/G > packets in remote.c so I'm happy with this patch instead (which adds > the test that you wanted): > > * remote.c (init_remote_state): Eliminate use of > deprecated_register_bytes(). This is fine with me. -- Daniel Jacobowitz CodeSourcery, LLC