From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28862 invoked by alias); 7 Nov 2007 11:31:55 -0000 Received: (qmail 28851 invoked by uid 22791); 7 Nov 2007 11:31:55 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Nov 2007 11:31:53 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.1/8.14.0) with ESMTP id lA7BUEC6002815; Wed, 7 Nov 2007 12:30:14 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1/Submit) id lA7BUDaD014732; Wed, 7 Nov 2007 12:30:13 +0100 (CET) Date: Wed, 07 Nov 2007 11:31:00 -0000 Message-Id: <200711071130.lA7BUDaD014732@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: deuling@de.ibm.com CC: gdb-patches@sourceware.org, uweigand@de.ibm.com In-reply-to: <47319D46.8080904@de.ibm.com> (message from Markus Deuling on Wed, 07 Nov 2007 12:11:02 +0100) Subject: Re: [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c References: <47319D46.8080904@de.ibm.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: 2007-11/txt/msg00122.txt.bz2 > Date: Wed, 07 Nov 2007 12:11:02 +0100 > From: Markus Deuling > > Hi, > > this patch adds gdbarch as a parameter to hppa_linux_register_addr. > > Tested with gdb_mbuild. Ok to commit ? Actually, this is getting a bit silly. That gdbarch is only needed for a sanaity check, and obviously the gdbarch_num_regs call can just be replaced with an appropriate bounds check on the u_offsets array. if (regno < 0 || regno >= ARRAY_SIZE(u_offsets)) should do the trick. > ChangeLog: > > * hppa-linux-nat.c (hppa_linux_register_addr): Add gdbarch as parameter. > Replace current_gdbarch by gdbarch. > (fetch_register, store_register): Update caller of > hppa_linux_register_addr.