From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21943 invoked by alias); 12 Feb 2009 16:24:07 -0000 Received: (qmail 21932 invoked by uid 22791); 12 Feb 2009 16:24:06 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Feb 2009 16:23:58 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LXeLz-0000CH-VZ for gdb-patches@sources.redhat.com; Thu, 12 Feb 2009 16:23:56 +0000 Received: from entropy.qnx.com ([209.226.137.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Feb 2009 16:23:55 +0000 Received: from aristovski by entropy.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Feb 2009 16:23:55 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: [patch] mips-tdep: info registers Date: Thu, 12 Feb 2009 16:24:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060302070604000707080601" User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) 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: 2009-02/txt/msg00286.txt.bz2 This is a multi-part message in MIME format. --------------060302070604000707080601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 677 Hello, This is applicable to mips targets. When using info registers $N command, gdb_assert will be triggered if N falls in the raw register number area. However, this is counter-intuitive. The change simply maps raw-register number to pseudo register number and continues as before. ------------------------------------- Example: current situation (gdb) info registers $1 ../../gdb/mips-tdep.c:4307: internal-error: mips_print_registers_info: Assertion `regnum >= gdbarch_num_regs (current_gdbarch)' failed. Example: with the patch (gdb) info registers $1 at: 0x8020000 -------------------------------------- Thanks, Aleksandar Ristovski QNX Software Systems --------------060302070604000707080601 Content-Type: text/plain; name="mips-tdep.c-info-registers-20090212.diff.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mips-tdep.c-info-registers-20090212.diff.ChangeLog" Content-length: 146 2009-02-12 Aleksandar Ristovski * mips-tdep.c (mips_print_registers_info): Map raw register number to pseudo register. --------------060302070604000707080601 Content-Type: text/x-patch; name="mips-tdep.c-info-registers-20090212.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mips-tdep.c-info-registers-20090212.diff" Content-length: 743 Index: gdb/mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.489 diff -u -p -r1.489 mips-tdep.c --- gdb/mips-tdep.c 3 Jan 2009 05:57:52 -0000 1.489 +++ gdb/mips-tdep.c 12 Feb 2009 16:19:02 -0000 @@ -4601,7 +4601,9 @@ mips_print_registers_info (struct gdbarc { if (regnum != -1) /* do one specified register */ { - gdb_assert (regnum >= gdbarch_num_regs (gdbarch)); + if (regnum < gdbarch_num_regs (gdbarch) + && regnum >= 0) + regnum += gdbarch_num_regs (gdbarch); /* Print pseudo register. */ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') error (_("Not a valid register for the current processor type")); --------------060302070604000707080601--