From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6336 invoked by alias); 27 Jul 2003 21:23:10 -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 6324 invoked from network); 27 Jul 2003 21:23:08 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 27 Jul 2003 21:23:08 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id C02692B7F; Sun, 27 Jul 2003 17:22:59 -0400 (EDT) Message-ID: <3F2442B3.1000506@redhat.com> Date: Sun, 27 Jul 2003 21:23:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steve Watt Cc: gdb-patches@sources.redhat.com Subject: Re: [patch rfc, 6.0?] only allow raw raw registers; Was: [patch rfc] Add NUM_REGS pseudo regs to MIPS References: <200307271855.h6RItIho043770@oberon.asicdesigners.com> Content-Type: multipart/mixed; boundary="------------030007000504090001060500" X-SW-Source: 2003-07/txt/msg00481.txt.bz2 This is a multi-part message in MIME format. --------------030007000504090001060500 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1163 > Undefined info command: "regs". Try "help info". > (gdb) info regi > zero at v0 v1 a0 a1 a2 a3 > R90 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > t0 t1 t2 t3 t4 t5 t6 t7 > R98 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > s0 s1 s2 s3 s4 s5 s6 s7 > R106 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > t8 t9 k0 k1 gp sp s8 ra > R114 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > sr lo hi bad cause pc > 00400004 00000000 00000000 00000000 00000000 a0020004 > fsr fir > 00000000 00000000 > (gdb) > > It's displaying stuff (and further runs appear correct), but the register > number in the left column needs 90 subtracted. (Well, I'm sure there's > a real fix, but...) Ah, oops. The real fix IS `regnum - 90' (well regnum % NUM_REGS). See attached. Andrew --------------030007000504090001060500 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 877 2003-07-27 Andrew Cagney * mips-tdep.c (print_gp_register_row): Print the GPR's register MOD NUM_REGS. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.223 diff -u -r1.223 mips-tdep.c --- mips-tdep.c 7 Jul 2003 17:36:26 -0000 1.223 +++ mips-tdep.c 27 Jul 2003 21:15:40 -0000 @@ -4286,10 +4286,10 @@ col++; } /* print the R0 to R31 names */ - fprintf_filtered (file, - (start_regnum % NUM_REGS) < MIPS_NUMREGS - ? "\n R%-4d" : "\n ", - start_regnum); + if ((start_regnum % NUM_REGS) < MIPS_NUMREGS) + fprintf_filtered (file, "\n R%-4d", start_regnum % NUM_REGS); + else + fprintf_filtered (file, "\n "); /* now print the values in hex, 4 or 8 to the row */ for (col = 0, regnum = start_regnum; --------------030007000504090001060500--