Add the fullname_syntax testsuite variable. This allows GDB to make sure
[deliverable/binutils-gdb.git] / gdb / i386-tdep.c
index d5cd111c90193949a9633f110637e774ef880b18..36b06301bd91db672e93a248c0eb6ce82e53a4fa 100644 (file)
@@ -1,7 +1,7 @@
 /* Intel 386 target-dependent stuff.
 
    Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
    Foundation, Inc.
 
    This file is part of GDB.
@@ -984,8 +984,12 @@ i386_frame_prev_register (struct frame_info *next_frame, void **this_cache,
 
   if (regnum == I386_EIP_REGNUM && cache->pc_in_eax)
     {
-      frame_register_unwind (next_frame, I386_EAX_REGNUM,
-                            optimizedp, lvalp, addrp, realnump, valuep);
+      *optimizedp = 0;
+      *lvalp = lval_register;
+      *addrp = 0;
+      *realnump = I386_EAX_REGNUM;
+      if (valuep)
+       frame_unwind_register (next_frame, (*realnump), valuep);
       return;
     }
 
@@ -1018,8 +1022,12 @@ i386_frame_prev_register (struct frame_info *next_frame, void **this_cache,
       return;
     }
 
-  frame_register_unwind (next_frame, regnum,
-                        optimizedp, lvalp, addrp, realnump, valuep);
+  *optimizedp = 0;
+  *lvalp = lval_register;
+  *addrp = 0;
+  *realnump = regnum;
+  if (valuep)
+    frame_unwind_register (next_frame, (*realnump), valuep);
 }
 
 static const struct frame_unwind i386_frame_unwind =
@@ -1215,7 +1223,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   /* Push arguments in reverse order.  */
   for (i = nargs - 1; i >= 0; i--)
     {
-      int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
+      int len = TYPE_LENGTH (value_enclosing_type (args[i]));
 
       /* The System V ABI says that:
 
@@ -1225,7 +1233,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
         This makes sure the stack says word-aligned.  */
       sp -= (len + 3) & ~3;
-      write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
+      write_memory (sp, value_contents_all (args[i]), len);
     }
 
   /* Push value address.  */
@@ -1281,7 +1289,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
     {
       if (tdep->st0_regnum < 0)
        {
-         warning ("Cannot find floating-point return value.");
+         warning (_("Cannot find floating-point return value."));
          memset (valbuf, 0, len);
          return;
        }
@@ -1312,7 +1320,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
        }
       else
        internal_error (__FILE__, __LINE__,
-                       "Cannot extract return value of %d bytes long.", len);
+                       _("Cannot extract return value of %d bytes long."), len);
     }
 }
 
@@ -1337,7 +1345,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
 
       if (tdep->st0_regnum < 0)
        {
-         warning ("Cannot set floating-point return value.");
+         warning (_("Cannot set floating-point return value."));
          return;
        }
 
@@ -1380,7 +1388,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
        }
       else
        internal_error (__FILE__, __LINE__,
-                       "Cannot store return value of %d bytes long.", len);
+                       _("Cannot store return value of %d bytes long."), len);
     }
 
 #undef I387_ST0_REGNUM
@@ -1481,6 +1489,70 @@ i386_return_value (struct gdbarch *gdbarch, struct type *type,
 }
 \f
 
+/* Types for the MMX and SSE registers.  */
+static struct type *i386_mmx_type;
+static struct type *i386_sse_type;
+
+/* Construct the type for MMX registers.  */
+static struct type *
+i386_build_mmx_type (void)
+{
+  /* The type we're building is this: */
+#if 0
+  union __gdb_builtin_type_vec64i 
+  {
+    int64_t uint64;
+    int32_t v2_int32[2];
+    int16_t v4_int16[4];
+    int8_t v8_int8[8];
+  };
+#endif
+
+  if (! i386_mmx_type)
+    {
+      struct type *t;
+
+      t = init_composite_type ("__gdb_builtin_type_vec64i", TYPE_CODE_UNION);
+      append_composite_type_field (t, "uint64", builtin_type_int64);
+      append_composite_type_field (t, "v2_int32", builtin_type_v2_int32);
+      append_composite_type_field (t, "v4_int16", builtin_type_v4_int16);
+      append_composite_type_field (t, "v8_int8", builtin_type_v8_int8);
+
+      TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR;
+      TYPE_NAME (t) = "builtin_type_vec64i";
+
+      i386_mmx_type = t;
+    }
+
+  return i386_mmx_type;
+}
+
+/* Construct the type for SSE registers.  */
+static struct type *
+i386_build_sse_type (void)
+{
+  if (! i386_sse_type)
+    {
+      struct type *t;
+
+      t = init_composite_type ("__gdb_builtin_type_vec128i", TYPE_CODE_UNION);
+      append_composite_type_field (t, "v4_float", builtin_type_v4_float);
+      append_composite_type_field (t, "v2_double", builtin_type_v2_double);
+      append_composite_type_field (t, "v16_int8", builtin_type_v16_int8);
+      append_composite_type_field (t, "v8_int16", builtin_type_v8_int16);
+      append_composite_type_field (t, "v4_int32", builtin_type_v4_int32);
+      append_composite_type_field (t, "v2_int64", builtin_type_v2_int64);
+      append_composite_type_field (t, "uint128", builtin_type_int128);
+
+      TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR;
+      TYPE_NAME (t) = "builtin_type_vec128i";
+      
+      i386_sse_type = t;
+    }
+
+  return i386_sse_type;
+}
+
 /* Return the GDB type object for the "standard" data type of data in
    register REGNUM.  Perhaps %esi and %edi should go here, but
    potentially they could be used for things other than address.  */
@@ -1496,10 +1568,10 @@ i386_register_type (struct gdbarch *gdbarch, int regnum)
     return builtin_type_i387_ext;
 
   if (i386_sse_regnum_p (gdbarch, regnum))
-    return builtin_type_vec128i;
+    return i386_build_sse_type ();
 
   if (i386_mmx_regnum_p (gdbarch, regnum))
-    return builtin_type_vec64i;
+    return i386_build_mmx_type ();
 
   return builtin_type_int;
 }
@@ -1954,7 +2026,6 @@ i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   i386_elf_init_abi (info, gdbarch);
 
   /* System V Release 4 has shared libraries.  */
-  set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 
   tdep->sigtramp_p = i386_svr4_sigtramp_p;
@@ -2268,32 +2339,26 @@ _initialize_i386_tdep (void)
   register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init);
 
   /* Add the variable that controls the disassembly flavor.  */
-  {
-    struct cmd_list_element *new_cmd;
-
-    new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
-                               valid_flavors,
-                               &disassembly_flavor,
-                               "\
-Set the disassembly flavor, the valid values are \"att\" and \"intel\", \
-and the default value is \"att\".",
-                               &setlist);
-    deprecated_add_show_from_set (new_cmd, &showlist);
-  }
+  add_setshow_enum_cmd ("disassembly-flavor", no_class, valid_flavors,
+                       &disassembly_flavor, _("\
+Set the disassembly flavor."), _("\
+Show the disassembly flavor."), _("\
+The valid values are \"att\" and \"intel\", and the default value is \"att\"."),
+                       NULL,
+                       NULL, /* FIXME: i18n: */
+                       &setlist, &showlist);
 
   /* Add the variable that controls the convention for returning
      structs.  */
-  {
-    struct cmd_list_element *new_cmd;
-
-    new_cmd = add_set_enum_cmd ("struct-convention", no_class,
-                               valid_conventions,
-                               &struct_convention, "\
-Set the convention for returning small structs, valid values \
-are \"default\", \"pcc\" and \"reg\", and the default value is \"default\".",
-                                &setlist);
-    deprecated_add_show_from_set (new_cmd, &showlist);
-  }
+  add_setshow_enum_cmd ("struct-convention", no_class, valid_conventions,
+                       &struct_convention, _("\
+Set the convention for returning small structs."), _("\
+Show the convention for returning small structs."), _("\
+Valid values are \"default\", \"pcc\" and \"reg\", and the default value\n\
+is \"default\"."),
+                       NULL,
+                       NULL, /* FIXME: i18n: */
+                       &setlist, &showlist);
 
   gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
                                  i386_coff_osabi_sniffer);
This page took 0.102012 seconds and 4 git commands to generate.