]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/xtensa-tdep.c
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / xtensa-tdep.c
index 316a8cf5194a87b237de217d0eaa17492069c5e2..3cdb27a2672022c55870896a3b65ba220993b2cd 100644 (file)
@@ -1,7 +1,6 @@
 /* Target-dependent code for the Xtensa port of GDB, the GNU debugger.
 
-   Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -56,7 +55,7 @@
 #include "xtensa-config.h"
 
 
-static int xtensa_debug_level = 0;
+static unsigned int xtensa_debug_level = 0;
 
 #define DEBUGWARN(args...) \
   if (xtensa_debug_level > 0) \
@@ -318,15 +317,14 @@ xtensa_register_type (struct gdbarch *gdbarch, int regnum)
 
              if (tp == NULL)
                {
-                 char *name = xmalloc (16);
+                 char *name = xstrprintf ("int%d", size * 8);
                  tp = xmalloc (sizeof (struct ctype_cache));
                  tp->next = tdep->type_entries;
                  tdep->type_entries = tp;
                  tp->size = size;
-
-                 sprintf (name, "int%d", size * 8);
                  tp->virtual_type
-                   = arch_integer_type (gdbarch, size * 8, 1, xstrdup (name));
+                   = arch_integer_type (gdbarch, size * 8, 1, name);
+                 xfree (name);
                }
 
              reg->ctype = tp->virtual_type;
@@ -667,7 +665,6 @@ xtensa_pseudo_register_write (struct gdbarch *gdbarch,
       && (regnum <= gdbarch_tdep (gdbarch)->a0_base + 15))
     {
       gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
-      unsigned int wb;
 
       regcache_raw_read (regcache,
                         gdbarch_tdep (gdbarch)->wb_regnum, buf);
@@ -843,7 +840,8 @@ xtensa_register_reggroup_p (struct gdbarch *gdbarch,
   if (group == restore_reggroup)
     return (regnum < gdbarch_num_regs (gdbarch)
            && (reg->flags & SAVE_REST_FLAGS) == SAVE_REST_VALID);
-  if ((cp_number = xtensa_coprocessor_register_group (group)) >= 0)
+  cp_number = xtensa_coprocessor_register_group (group);
+  if (cp_number >= 0)
     return rg & (xtRegisterGroupCP0 << cp_number);
   else
     return 1;
@@ -1549,6 +1547,7 @@ static const struct frame_unwind
 xtensa_unwind =
 {
   NORMAL_FRAME,
+  default_frame_unwind_stop_reason,
   xtensa_frame_this_id,
   xtensa_frame_prev_register,
   NULL,
@@ -1682,7 +1681,7 @@ xtensa_store_return_value (struct type *type,
 
 static enum return_value_convention
 xtensa_return_value (struct gdbarch *gdbarch,
-                    struct type *func_type,
+                    struct value *function,
                     struct type *valtype,
                     struct regcache *regcache,
                     gdb_byte *readbuf,
@@ -2714,9 +2713,9 @@ call0_frame_cache (struct frame_info *this_frame,
         too bad.  */
 
       int i;
-      for (i = 0; 
-          (i < C0_NREGS) &&
-            (i == C0_RA || cache->c0.c0_rt[i].fr_reg != C0_RA);
+      for (i = 0;
+          (i < C0_NREGS)
+          && (i == C0_RA || cache->c0.c0_rt[i].fr_reg != C0_RA);
           ++i);
       if (i >= C0_NREGS && cache->c0.c0_rt[C0_RA].fr_reg == C0_RA)
        i = C0_RA;
@@ -2816,7 +2815,6 @@ execute_code (struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR wb)
   void (*func) (struct gdbarch *, int, int, int, CORE_ADDR);
 
   int at, as, offset;
-  int num_operands;
 
   /* WindowUnderflow12 = true, when inside _WindowUnderflow12.  */ 
   int WindowUnderflow12 = (current_pc & 0x1ff) >= 0x140; 
@@ -3310,14 +3308,14 @@ _initialize_xtensa_tdep (void)
   gdbarch_register (bfd_arch_xtensa, xtensa_gdbarch_init, xtensa_dump_tdep);
   xtensa_init_reggroups ();
 
-  add_setshow_zinteger_cmd ("xtensa",
-                           class_maintenance,
-                           &xtensa_debug_level,
+  add_setshow_zuinteger_cmd ("xtensa",
+                            class_maintenance,
+                            &xtensa_debug_level,
                            _("Set Xtensa debugging."),
                            _("Show Xtensa debugging."), _("\
 When non-zero, Xtensa-specific debugging is enabled. \
 Can be 1, 2, 3, or 4 indicating the level of debugging."),
-                           NULL,
-                           NULL,
-                           &setdebuglist, &showdebuglist);
+                            NULL,
+                            NULL,
+                            &setdebuglist, &showdebuglist);
 }