This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch rfc, 6.0?] only allow raw raw registers; Was: [patch rfc]Add NUM_REGS pseudo regs to MIPS
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Steve Watt <steve at asicdesigners dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 27 Jul 2003 17:22:59 -0400
- 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>
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
2003-07-27 Andrew Cagney <cagney@redhat.com>
* 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;