From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3049 invoked by alias); 23 Feb 2009 17:36:37 -0000 Received: (qmail 2754 invoked by uid 22791); 23 Feb 2009 17:36:36 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,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; Mon, 23 Feb 2009 17:36:29 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LbejC-0006LX-8D for gdb-patches@sources.redhat.com; Mon, 23 Feb 2009 17:36:26 +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 ; Mon, 23 Feb 2009 17:36:26 +0000 Received: from aristovski by entropy.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Feb 2009 17:36:26 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: [patch] mips-tdep: info registers Date: Mon, 23 Feb 2009 18:24:00 -0000 Message-ID: References: <20090223020820.GC26056@adacore.com> <20090223025230.GA11699@caradoc.them.org> <200902230718.n1N7IoBD028396@brahms.sibelius.xs4all.nl> <20090223161756.GA19411@caradoc.them.org> <20090223162602.GH26056@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040205050507050400070500" User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) In-Reply-To: <20090223162602.GH26056@adacore.com> 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/msg00447.txt.bz2 This is a multi-part message in MIME format. --------------040205050507050400070500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 663 Joel Brobecker wrote: >> The problem is, this doesn't do what you want it to do. It looks up >> GDB internal register number 1. That just happens, at the moment, >> to match up with the raw register backing $at. But it might change >> in the future. It's not "the register named $1", which is what a >> MIPS user should expect. > > I agree, now, that we shouldn't have this feature. I can have a look > at removing it... > Joel, the attached removes numeric value syntax, but allows it for mips; mips will explicitly map regno to raw regno (which is currently 1-1). I will let you take it from here. Thanks, Aleksandar Ristovski QNX Software Systems --------------040205050507050400070500 Content-Type: text/x-patch; name="mips-tdep.c-info-registers-20090223.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mips-tdep.c-info-registers-20090223.diff" Content-length: 1406 Index: gdb/infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.231 diff -r1.231 infcmd.c 1951,1965d1950 < /* A register number? (how portable is this one?). */ < { < char *endptr; < int regnum = strtol (start, &endptr, 0); < if (endptr == end < && regnum >= 0 < && regnum < gdbarch_num_regs (gdbarch) < + gdbarch_num_pseudo_regs (gdbarch)) < { < gdbarch_print_registers_info (gdbarch, gdb_stdout, < frame, regnum, fpregs); < continue; < } < } < Index: gdb/mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.490 diff -r1.490 mips-tdep.c 442a443,449 > static char *mips_gpr_numeric_names[] = { > "0", "1", "2", "3", "4", "5", "6", "7", > "8", "9", "10", "11", "12", "13", "14", "15", > "16", "17", "18", "19", "20", "21", "22", "23", > "24", "25", "26", "27", "28", "29", "30", "31" > }; > 449c456,461 < return ""; --- > { > if (regno >= 0) > return mips_gpr_numeric_names [regno]; > else > return ""; > } 4604c4616,4618 < gdb_assert (regnum >= gdbarch_num_regs (gdbarch)); --- > if (regnum < gdbarch_num_regs (gdbarch) > && regnum >= 0) > regnum += gdbarch_num_regs (gdbarch); /* Print pseudo register. */ --------------040205050507050400070500--