opcodes/
[binutils-gdb.git] / gdb / rx-tdep.c
index 6506de93138468590bb3b24d4d994705a4efbd6c..9cc414a55059bab76642592ea29e6b11d9bc9999 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the Renesas RX for GDB, the GNU debugger.
 
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2013 Free Software Foundation, Inc.
 
    Contributed by Red Hat, Inc.
 
@@ -46,7 +46,8 @@ enum
   RX_FP_REGNUM = 6,
   RX_R15_REGNUM = 15,
   RX_PC_REGNUM = 19,
-  RX_NUM_REGS = 25
+  RX_ACC_REGNUM = 25,
+  RX_NUM_REGS = 26
 };
 
 /* Architecture specific data.  */
@@ -111,15 +112,16 @@ rx_register_name (struct gdbarch *gdbarch, int regnr)
     "r13",
     "r14",
     "r15",
-    "isp",
     "usp",
-    "intb",
-    "pc",
+    "isp",
     "psw",
-    "bpc",
+    "pc",
+    "intb",
     "bpsw",
-    "vct",
-    "fpsw"
+    "bpc",
+    "fintv",
+    "fpsw",
+    "acc"
   };
 
   return reg_names[regnr];
@@ -131,6 +133,8 @@ rx_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
   if (reg_nr == RX_PC_REGNUM)
     return builtin_type (gdbarch)->builtin_func_ptr;
+  else if (reg_nr == RX_ACC_REGNUM)
+    return builtin_type (gdbarch)->builtin_unsigned_long_long;
   else
     return builtin_type (gdbarch)->builtin_unsigned_long;
 }
@@ -150,7 +154,7 @@ check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
   if (value.kind == pvk_register
       && value.k == 0
       && pv_is_register (addr, RX_SP_REGNUM)
-      && size == register_size (target_gdbarch, value.reg))
+      && size == register_size (target_gdbarch (), value.reg))
     result->reg_offset[value.reg] = addr.k;
 }
 
@@ -203,7 +207,7 @@ rx_analyze_prologue (CORE_ADDR start_pc,
       result->reg_offset[rn] = 1;
     }
 
-  stack = make_pv_area (RX_SP_REGNUM, gdbarch_addr_bit (target_gdbarch));
+  stack = make_pv_area (RX_SP_REGNUM, gdbarch_addr_bit (target_gdbarch ()));
   back_to = make_cleanup_free_pv_area (stack);
 
   /* The call instruction has saved the return address on the stack.  */
@@ -292,7 +296,6 @@ rx_analyze_prologue (CORE_ADDR start_pc,
        }
       else if (opc.id == RXO_branch
               && opc.op[0].type == RX_Operand_Immediate
-              && opc.op[1].type == RX_Operand_Condition
               && next_pc < opc.op[0].addend)
        {
          /* When a loop appears as the first statement of a function
@@ -350,7 +353,7 @@ rx_analyze_prologue (CORE_ADDR start_pc,
 static CORE_ADDR
 rx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  char *name;
+  const char *name;
   CORE_ADDR func_addr, func_end;
   struct rx_prologue p;
 
@@ -452,6 +455,7 @@ rx_frame_prev_register (struct frame_info *this_frame,
 
 static const struct frame_unwind rx_frame_unwind = {
   NORMAL_FRAME,
+  default_frame_unwind_stop_reason,
   rx_frame_this_id,
   rx_frame_prev_register,
   NULL,
@@ -698,7 +702,7 @@ rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 /* Implement the "return_value" gdbarch method.  */
 static enum return_value_convention
 rx_return_value (struct gdbarch *gdbarch,
-                struct type *func_type,
+                struct value *function,
                 struct type *valtype,
                 struct regcache *regcache,
                 gdb_byte *readbuf, const gdb_byte *writebuf)
@@ -752,7 +756,7 @@ rx_return_value (struct gdbarch *gdbarch,
 }
 
 /* Implement the "breakpoint_from_pc" gdbarch method.  */
-const gdb_byte *
+static const gdb_byte *
 rx_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
 {
   static gdb_byte breakpoint[] = { 0x00 };
@@ -855,7 +859,11 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   return gdbarch;
 }
 
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_rx_tdep;
+
 /* Register the above initialization routine.  */
+
 void
 _initialize_rx_tdep (void)
 {