From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3696 invoked by alias); 27 Jun 2003 17:20:16 -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 3684 invoked from network); 27 Jun 2003 17:20:14 -0000 Received: from unknown (HELO mailhost.intrinsity.com) (208.246.32.130) by sources.redhat.com with SMTP; 27 Jun 2003 17:20:14 -0000 Received: from victoria.intrinsity.com (victoria.eng.intrinsity.com [192.168.1.29]) by mailhost.intrinsity.com (Postfix) with ESMTP id 16E933F3B3 for ; Fri, 27 Jun 2003 12:20:14 -0500 (CDT) Received: from bletchley.vert.intrinsity.com (bletchley.vert.intrinsity.com [192.168.3.33]) by victoria.intrinsity.com (Postfix) with ESMTP id B91AE4586C; Fri, 27 Jun 2003 12:20:13 -0500 (CDT) Received: by bletchley.vert.intrinsity.com (Postfix, from userid 621) id 54F648B5FD; Fri, 27 Jun 2003 17:20:13 +0000 (UTC) Subject: [RFA] Testing REGISTER_NAME in mips-linux-nat.c To: gdb-patches@sources.redhat.com Date: Fri, 27 Jun 2003 17:20:00 -0000 Cc: fnf@intrinsity.com (Fred Fish) Reply-To: fnf@intrinsity.com (Fred Fish) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030627172013.54F648B5FD@bletchley.vert.intrinsity.com> From: fnf@intrinsity.com (Fred Fish) X-SW-Source: 2003-06/txt/msg00820.txt.bz2 A recent change to mips_register_name to return a empty string for register numbers < NUM_REGS is causing problems with the native mips linux port. The change in mips_register_name is: + /* Map [NUM_REGS .. 2*NUM_REGS) onto the raw registers, but then + don't make the raw register names visible. */ + int rawnum = regno % NUM_REGS; + if (regno < NUM_REGS) + return ""; Now for example when mips_linux_cannot_fetch_register() is called with regno == PC_REGNUM, it will return 1 and reading of the PC will return zero as the PC value. I think this is the correct patch, but I'm not 100% sure. Perhaps we can just eliminate the REGISTER_NAME check completely. -Fred ============================================================================ 2003-06-27 Fred Fish * mips-linux-nat.c (mips_linux_cannot_fetch_register): Only test register name if it is a pseudo register. Index: mips-linux-nat.c =================================================================== RCS file: /mips/newtools/fsf/gdb/gdb/mips-linux-nat.c,v retrieving revision 1.2 diff -c -p -r1.2 mips-linux-nat.c *** mips-linux-nat.c 2003/02/18 21:36:24 1.2 --- mips-linux-nat.c 2003/06/27 17:11:38 *************** *** 29,35 **** int mips_linux_cannot_fetch_register (int regno) { ! if (REGISTER_NAME (regno)[0] == 0) return 1; if (regno == PS_REGNUM) return 1; --- 29,35 ---- int mips_linux_cannot_fetch_register (int regno) { ! if (regno >= NUM_REGS && REGISTER_NAME (regno)[0] == 0) return 1; if (regno == PS_REGNUM) return 1; *************** mips_linux_cannot_fetch_register (int re *** 42,48 **** int mips_linux_cannot_store_register (int regno) { ! if (REGISTER_NAME (regno)[0] == 0) return 1; if (regno == PS_REGNUM) return 1; --- 42,48 ---- int mips_linux_cannot_store_register (int regno) { ! if (regno >= NUM_REGS && REGISTER_NAME (regno)[0] == 0) return 1; if (regno == PS_REGNUM) return 1;