From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17425 invoked by alias); 23 Feb 2009 02:08:35 -0000 Received: (qmail 17416 invoked by uid 22791); 23 Feb 2009 02:08:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 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; Mon, 23 Feb 2009 02:08:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AEDB92BAB63; Sun, 22 Feb 2009 21:08:25 -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 6oPen3I9Neeo; Sun, 22 Feb 2009 21:08:25 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7205C2BAB60; Sun, 22 Feb 2009 21:08:25 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 8A12BE7ACD; Sun, 22 Feb 2009 18:08:20 -0800 (PST) Date: Mon, 23 Feb 2009 02:52:00 -0000 From: Joel Brobecker To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] mips-tdep: info registers Message-ID: <20090223020820.GC26056@adacore.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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/msg00428.txt.bz2 > (gdb) info registers $1 > ../../gdb/mips-tdep.c:4307: internal-error: > mips_print_registers_info: > Assertion `regnum >= gdbarch_num_regs (current_gdbarch)' > failed. Surprisingly, this feature is not documented yet. The documentation mentions "info registers regname", but not "info registers regno". Would you mind adding a line or two and sending a (separate) patch to this list? Eli is the documentation guru... > (gdb) info registers $1 > at: 0x8020000 > 2009-02-12 Aleksandar Ristovski > > * mips-tdep.c (mips_print_registers_info): Map raw register number to > pseudo register. This seems reasonable to me. Just being a documentation freak, can you provide a more detailed comment about what is happening and what you are doing? Below is my suggestion - adjust as you think is best... > - gdb_assert (regnum >= gdbarch_num_regs (gdbarch)); > + if (regnum < gdbarch_num_regs (gdbarch) > + && regnum >= 0) > + regnum += gdbarch_num_regs (gdbarch); /* Print pseudo register. */ /* If given a raw register number, convert it to its associated pseudo register number first, since the rest of this code requires a pseudo register. */ Pre-approved with the addition of the comment requested. Can you also confirm that you were able to check this change against the testsuite? I don't see how this could negatively affect the debugger, but you never know sometimes... Thanks, -- Joel