* configure.ac: Use AC_CHECK_DECLS instead of gcc_AC_CHECK_DECLS
[deliverable/binutils-gdb.git] / gdb / mips-tdep.c
index 7ad78dac9cd40530e424428f645998054b7777ac..8d9d855cfe5cf90e7fa010f71ff57b4d870ab66d 100644 (file)
@@ -878,17 +878,10 @@ mips_fetch_instruction (CORE_ADDR addr)
 #define rtype_shamt(x) ((x >> 6) & 0x1f)
 #define rtype_funct(x) (x & 0x3f)
 
-static CORE_ADDR
-mips32_relative_offset (unsigned long inst)
+static LONGEST
+mips32_relative_offset (ULONGEST inst)
 {
-  long x;
-  x = itype_immediate (inst);
-  if (x & 0x8000)              /* sign bit set */
-    {
-      x |= 0xffff0000;         /* sign extension */
-    }
-  x = x << 2;
-  return x;
+  return ((itype_immediate (inst) ^ 0x8000) - 0x8000) << 2;
 }
 
 /* Determine whate to set a single step breakpoint while considering
@@ -2408,7 +2401,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
      than necessary for EABI, because the first few arguments are
      passed in registers, but that's OK.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+    len += align_up (TYPE_LENGTH (value_type (args[argnum])),
                     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
@@ -2439,7 +2432,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       char *val;
       char valbuf[MAX_REGISTER_SIZE];
       struct value *arg = args[argnum];
-      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+      struct type *arg_type = check_typedef (value_type (arg));
       int len = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
 
@@ -2691,7 +2684,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+    len += align_up (TYPE_LENGTH (value_type (args[argnum])),
                     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
@@ -2721,7 +2714,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
     {
       char *val;
       struct value *arg = args[argnum];
-      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+      struct type *arg_type = check_typedef (value_type (arg));
       int len = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
 
@@ -3030,7 +3023,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+    len += align_up (TYPE_LENGTH (value_type (args[argnum])),
                     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
@@ -3061,7 +3054,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
     {
       char *val;
       struct value *arg = args[argnum];
-      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+      struct type *arg_type = check_typedef (value_type (arg));
       int len = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
 
@@ -3484,7 +3477,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+    len += align_up (TYPE_LENGTH (value_type (args[argnum])),
                     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
@@ -3515,7 +3508,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
     {
       char *val;
       struct value *arg = args[argnum];
-      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+      struct type *arg_type = check_typedef (value_type (arg));
       int len = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
 
@@ -5195,7 +5188,8 @@ This option can be set to one of:\n\
           saved GP register size from information contained in the executable.\n\
           (default: auto)", "\
 Size of general purpose registers saved on the stack is %s.\n",
-                       NULL, NULL, &setmipscmdlist, &showmipscmdlist);
+                       NULL, NULL, &setmipscmdlist, &showmipscmdlist,
+                       NULL, NULL);
 
   /* Allow the user to override the argument stack size. */
   add_setshow_enum_cmd ("stack-arg-size", class_obscure,
@@ -5208,7 +5202,8 @@ This option can be set to one of:\n\
   auto  - Allow GDB to determine the correct setting from the current\n\
           target and executable (default)", "\
 The amount of stack space reserved for each argument is %s.\n",
-                       NULL, NULL, &setmipscmdlist, &showmipscmdlist);
+                       NULL, NULL, &setmipscmdlist, &showmipscmdlist,
+                       NULL, NULL);
 
   /* Allow the user to override the ABI. */
   c = add_set_enum_cmd
This page took 0.026437 seconds and 4 git commands to generate.