From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20244 invoked by alias); 7 Nov 2007 15:06:49 -0000 Received: (qmail 20156 invoked by uid 22791); 7 Nov 2007 15:06:28 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Nov 2007 15:06:26 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D877598353; Wed, 7 Nov 2007 15:06:24 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id BB1A99833F; Wed, 7 Nov 2007 15:06:24 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1IpmU3-0005Qp-Uv; Wed, 07 Nov 2007 10:06:23 -0500 Date: Wed, 07 Nov 2007 15:06:00 -0000 From: Daniel Jacobowitz To: Markus Deuling Cc: gdb-patches@sourceware.org, Mark Kettenis , Ulrich Weigand Subject: Re: [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c Message-ID: <20071107150623.GB20821@caradoc.them.org> Mail-Followup-To: Markus Deuling , gdb-patches@sourceware.org, Mark Kettenis , Ulrich Weigand References: <47319D46.8080904@de.ibm.com> <200711071130.lA7BUDaD014732@brahms.sibelius.xs4all.nl> <4731A642.6080402@de.ibm.com> <20071107125809.GA14179@caradoc.them.org> <4731D0B9.8000809@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4731D0B9.8000809@de.ibm.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes 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: 2007-11/txt/msg00131.txt.bz2 On Wed, Nov 07, 2007 at 03:50:33PM +0100, Markus Deuling wrote: > What this patch does is transform > > if ((unsigned) regno >= gdbarch_num_regs (current_gdbarch)) > error (_("Invalid register number %d."), regno); > > > into > > if ((unsigned) regno >= gdbarch_num_regs (gdbarch)) > error (_("Invalid register number %d."), regno); > > > The gdbarch comes from regcache in {fetch,store}_register. Why is that wrong ? Again, it is not necessary to add a gdbarch parameter here. Why are we checking regno? We're checking it because we're about to use it to index into the u_offsets array, and we don't want to go out of bounds. -- Daniel Jacobowitz CodeSourcery