* builtin-regs.c (value_of_builtin_reg): Correctly calculate the
authorRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 13 May 2002 16:25:08 +0000 (16:25 +0000)
committerRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 13 May 2002 16:25:08 +0000 (16:25 +0000)
builtin reg number.

gdb/ChangeLog
gdb/builtin-regs.c

index 98247ae67fe50bb3054b6b7feed2a31d02e95990..1b2ad4021c414178917dba7bd079b12152337664 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-13  Richard Earnshaw  <rearnsha@arm.com>
+
+       * builtin-regs.c (value_of_builtin_reg): Correctly calculate the
+       builtin reg number.
+
 2002-05-13  Daniel Jacobowitz  <drow@mvista.com>
 
        * ax-gdb.c (gen_sign_extend, gen_fetch, gen_usual_unary)
index f9a67818bf29d641ef02755d7c46cdb2478b23e5..8c488e3a55770aca7d58e65af101e7bfbf4a936f 100644 (file)
@@ -71,7 +71,7 @@ builtin_reg_map_name_to_regnum (const char *name, int len)
 struct value *
 value_of_builtin_reg (int regnum, struct frame_info *frame)
 {
-  int reg = regnum - NUM_REGS + NUM_PSEUDO_REGS;
+  int reg = regnum - (NUM_REGS + NUM_PSEUDO_REGS);
   gdb_assert (reg >= 0 && reg < nr_builtin_regs);
   return builtin_regs[reg].value (frame);
 }