From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20280 invoked by alias); 8 Dec 2011 08:25:13 -0000 Received: (qmail 20243 invoked by uid 22791); 8 Dec 2011 08:25:11 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Dec 2011 08:24:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 194AF2BB515; Thu, 8 Dec 2011 03:24:58 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZeAlAwzEaJF9; Thu, 8 Dec 2011 03:24:58 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E4B5E2BB511; Thu, 8 Dec 2011 03:24:57 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 2F360145615; Thu, 8 Dec 2011 00:24:56 -0800 (PST) Date: Thu, 08 Dec 2011 08:31:00 -0000 From: Joel Brobecker To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] MIPS: Fix pc_regnum and sp_regnum initialisation Message-ID: <20111208082456.GG21915@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-12/txt/msg00252.txt.bz2 > Register numbers used for pc_regnum and sp_regnum are in the cooked range > and therefore depend on the total number of registers. At some point the > MIPS/Linux OS ABI initialiser has been changed such that it may change the > number of available registers to add the artificial "restart" register. > Therefore cooked register numbers stored in gdbarch may only be > initialised once the OS ABI initialiser has run. Ugh... > 2011-12-06 Maciej W. Rozycki > > gdb/ > * mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and > sp_regnum once the gdbarch_init_osabi hook has been called. Thanks. This looks OK to me. > + /* The hook may have adjusted num_regs, fetch the final value and > + set pc_regnum and sp_regnum now that it has been fixed. */ > + /* FIXME: cagney/2003-11-15: For MIPS, hasn't gdbarch_pc_regnum been > + replaced by gdbarch_read_pc? */ It'd be interesting to answer Andrew's question, but that's for another rainy day (that would mean tomorrow if you lived in Vancouver :-). -- Joel