2003-04-23 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / i386-tdep.c
index e7b166f412e8197678719cb87f85a8c741de5ad5..88f392076321d3276f3ed01592286e013ff070f4 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 Free Software Foundation, Inc.
+   1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "gdb_assert.h"
 #include "reggroups.h"
 #include "dummy-frame.h"
+#include "osabi.h"
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
 
 /* Names of the registers.  The first 10 registers match the register
    numbering scheme used by GCC for stabs and DWARF.  */
+
 static char *i386_register_names[] =
 {
   "eax",   "ecx",    "edx",   "ebx",
@@ -60,6 +62,9 @@ static char *i386_register_names[] =
   "mxcsr"
 };
 
+static const int i386_num_register_names =
+  (sizeof (i386_register_names) / sizeof (*i386_register_names));
+
 /* MMX registers.  */
 
 static char *i386_mmx_names[] =
@@ -67,14 +72,17 @@ static char *i386_mmx_names[] =
   "mm0", "mm1", "mm2", "mm3",
   "mm4", "mm5", "mm6", "mm7"
 };
-static const int mmx_num_regs = (sizeof (i386_mmx_names)
-                                / sizeof (i386_mmx_names[0]));
-#define MM0_REGNUM (NUM_REGS)
+
+static const int i386_num_mmx_regs =
+  (sizeof (i386_mmx_names) / sizeof (i386_mmx_names[0]));
+
+#define MM0_REGNUM NUM_REGS
 
 static int
-i386_mmx_regnum_p (int reg)
+i386_mmx_regnum_p (int regnum)
 {
-  return (reg >= MM0_REGNUM && reg < MM0_REGNUM + mmx_num_regs);
+  return (regnum >= MM0_REGNUM
+         && regnum < MM0_REGNUM + i386_num_mmx_regs);
 }
 
 /* FP register?  */
@@ -83,14 +91,14 @@ int
 i386_fp_regnum_p (int regnum)
 {
   return (regnum < NUM_REGS
-         && (FP0_REGNUM && FP0_REGNUM <= (regnum) && (regnum) < FPC_REGNUM));
+         && (FP0_REGNUM && FP0_REGNUM <= regnum && regnum < FPC_REGNUM));
 }
 
 int
 i386_fpc_regnum_p (int regnum)
 {
   return (regnum < NUM_REGS
-         && (FPC_REGNUM <= (regnum) && (regnum) < XMM0_REGNUM));
+         && (FPC_REGNUM <= regnum && regnum < XMM0_REGNUM));
 }
 
 /* SSE register?  */
@@ -99,14 +107,14 @@ int
 i386_sse_regnum_p (int regnum)
 {
   return (regnum < NUM_REGS
-         && (XMM0_REGNUM <= (regnum) && (regnum) < MXCSR_REGNUM));
+         && (XMM0_REGNUM <= regnum && regnum < MXCSR_REGNUM));
 }
 
 int
 i386_mxcsr_regnum_p (int regnum)
 {
   return (regnum < NUM_REGS
-         && (regnum == MXCSR_REGNUM));
+         && regnum == MXCSR_REGNUM);
 }
 
 /* Return the name of register REG.  */
@@ -114,14 +122,13 @@ i386_mxcsr_regnum_p (int regnum)
 const char *
 i386_register_name (int reg)
 {
-  if (reg < 0)
-    return NULL;
+  if (reg >= 0 && reg < i386_num_register_names)
+    return i386_register_names[reg];
+
   if (i386_mmx_regnum_p (reg))
     return i386_mmx_names[reg - MM0_REGNUM];
-  if (reg >= sizeof (i386_register_names) / sizeof (*i386_register_names))
-    return NULL;
 
-  return i386_register_names[reg];
+  return NULL;
 }
 
 /* Convert stabs register number REG to the appropriate register
@@ -498,9 +505,10 @@ i386_get_frame_setup (CORE_ADDR pc)
 int
 i386_frameless_signal_p (struct frame_info *frame)
 {
-  return (frame->next && get_frame_type (frame->next) == SIGTRAMP_FRAME
+  return (get_next_frame (frame)
+         && get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME
          && (frameless_look_for_prologue (frame)
-             || get_frame_pc (frame) == get_pc_function_start (get_frame_pc (frame))));
+             || get_frame_pc (frame) == get_frame_func (frame)));
 }
 
 /* Return the chain-pointer for FRAME.  In the case of the i386, the
@@ -511,14 +519,14 @@ static CORE_ADDR
 i386_frame_chain (struct frame_info *frame)
 {
   if (pc_in_dummy_frame (get_frame_pc (frame)))
-    return frame->frame;
+    return get_frame_base (frame);
 
   if (get_frame_type (frame) == SIGTRAMP_FRAME
       || i386_frameless_signal_p (frame))
-    return frame->frame;
+    return get_frame_base (frame);
 
   if (! inside_entry_file (get_frame_pc (frame)))
-    return read_memory_unsigned_integer (frame->frame, 4);
+    return read_memory_unsigned_integer (get_frame_base (frame), 4);
 
   return 0;
 }
@@ -580,11 +588,11 @@ i386_frame_saved_pc (struct frame_info *frame)
 
   if (i386_frameless_signal_p (frame))
     {
-      CORE_ADDR sp = i386_sigtramp_saved_sp (frame->next);
+      CORE_ADDR sp = i386_sigtramp_saved_sp (get_next_frame (frame));
       return read_memory_unsigned_integer (sp, 4);
     }
 
-  return read_memory_unsigned_integer (frame->frame + 4, 4);
+  return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);
 }
 
 /* Immediately after a function call, return the saved pc.  */
@@ -598,80 +606,6 @@ i386_saved_pc_after_call (struct frame_info *frame)
   return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
 }
 
-/* Return number of args passed to a frame.
-   Can return -1, meaning no way to tell.  */
-
-static int
-i386_frame_num_args (struct frame_info *fi)
-{
-#if 1
-  return -1;
-#else
-  /* This loses because not only might the compiler not be popping the
-     args right after the function call, it might be popping args from
-     both this call and a previous one, and we would say there are
-     more args than there really are.  */
-
-  int retpc;
-  unsigned char op;
-  struct frame_info *pfi;
-
-  /* On the i386, the instruction following the call could be:
-     popl %ecx        -  one arg
-     addl $imm, %esp  -  imm/4 args; imm may be 8 or 32 bits
-     anything else    -  zero args.  */
-
-  int frameless;
-
-  frameless = FRAMELESS_FUNCTION_INVOCATION (fi);
-  if (frameless)
-    /* In the absence of a frame pointer, GDB doesn't get correct
-       values for nameless arguments.  Return -1, so it doesn't print
-       any nameless arguments.  */
-    return -1;
-
-  pfi = get_prev_frame (fi);
-  if (pfi == 0)
-    {
-      /* NOTE: This can happen if we are looking at the frame for
-         main, because FRAME_CHAIN_VALID won't let us go into start.
-         If we have debugging symbols, that's not really a big deal;
-         it just means it will only show as many arguments to main as
-         are declared.  */
-      return -1;
-    }
-  else
-    {
-      retpc = pfi->pc;
-      op = read_memory_integer (retpc, 1);
-      if (op == 0x59)          /* pop %ecx */
-       return 1;
-      else if (op == 0x83)
-       {
-         op = read_memory_integer (retpc + 1, 1);
-         if (op == 0xc4)
-           /* addl $<signed imm 8 bits>, %esp */
-           return (read_memory_integer (retpc + 2, 1) & 0xff) / 4;
-         else
-           return 0;
-       }
-      else if (op == 0x81)     /* `add' with 32 bit immediate.  */
-       {
-         op = read_memory_integer (retpc + 1, 1);
-         if (op == 0xc4)
-           /* addl $<imm 32>, %esp */
-           return read_memory_integer (retpc + 2, 4) / 4;
-         else
-           return 0;
-       }
-      else
-       {
-         return 0;
-       }
-    }
-#endif
-}
-
 /* Parse the first few instructions the function to see what registers
    were stored.
    
@@ -707,18 +641,18 @@ i386_frame_init_saved_regs (struct frame_info *fip)
   CORE_ADDR pc;
   int i;
 
-  if (fip->saved_regs)
+  if (get_frame_saved_regs (fip))
     return;
 
   frame_saved_regs_zalloc (fip);
 
-  pc = get_pc_function_start (get_frame_pc (fip));
+  pc = get_frame_func (fip);
   if (pc != 0)
     locals = i386_get_frame_setup (pc);
 
   if (locals >= 0)
     {
-      addr = fip->frame - 4 - locals;
+      addr = get_frame_base (fip) - 4 - locals;
       for (i = 0; i < 8; i++)
        {
          op = codestream_get ();
@@ -726,16 +660,16 @@ i386_frame_init_saved_regs (struct frame_info *fip)
            break;
 #ifdef I386_REGNO_TO_SYMMETRY
          /* Dynix uses different internal numbering.  Ick.  */
-         fip->saved_regs[I386_REGNO_TO_SYMMETRY (op - 0x50)] = addr;
+         get_frame_saved_regs (fip)[I386_REGNO_TO_SYMMETRY (op - 0x50)] = addr;
 #else
-         fip->saved_regs[op - 0x50] = addr;
+         get_frame_saved_regs (fip)[op - 0x50] = addr;
 #endif
          addr -= 4;
        }
     }
 
-  fip->saved_regs[PC_REGNUM] = fip->frame + 4;
-  fip->saved_regs[FP_REGNUM] = fip->frame;
+  get_frame_saved_regs (fip)[PC_REGNUM] = get_frame_base (fip) + 4;
+  get_frame_saved_regs (fip)[FP_REGNUM] = get_frame_base (fip);
 }
 
 /* Return PC of first real instruction.  */
@@ -867,7 +801,7 @@ i386_do_pop_frame (struct frame_info *frame)
   for (regnum = 0; regnum < NUM_REGS; regnum++)
     {
       CORE_ADDR addr;
-      addr = frame->saved_regs[regnum];
+      addr = get_frame_saved_regs (frame)[regnum];
       if (addr)
        {
          read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum));
@@ -890,15 +824,16 @@ i386_pop_frame (void)
 /* Figure out where the longjmp will land.  Slurp the args out of the
    stack.  We expect the first arg to be a pointer to the jmp_buf
    structure from which we extract the address that we will land at.
-   This address is copied into PC.  This routine returns true on
+   This address is copied into PC.  This routine returns non-zero on
    success.  */
 
 static int
 i386_get_longjmp_target (CORE_ADDR *pc)
 {
-  char buf[4];
+  char buf[8];
   CORE_ADDR sp, jb_addr;
   int jb_pc_offset = gdbarch_tdep (current_gdbarch)->jb_pc_offset;
+  int len = TYPE_LENGTH (builtin_type_void_func_ptr);
 
   /* If JB_PC_OFFSET is -1, we have no way to find out where the
      longjmp will land.  */
@@ -906,14 +841,14 @@ i386_get_longjmp_target (CORE_ADDR *pc)
     return 0;
 
   sp = read_register (SP_REGNUM);
-  if (target_read_memory (sp + 4, buf, 4))
+  if (target_read_memory (sp + len, buf, len))
     return 0;
 
-  jb_addr = extract_address (buf, 4);
-  if (target_read_memory (jb_addr + jb_pc_offset, buf, 4))
+  jb_addr = extract_typed_address (buf, builtin_type_void_func_ptr);
+  if (target_read_memory (jb_addr + jb_pc_offset, buf, len))
     return 0;
 
-  *pc = extract_address (buf, 4);
+  *pc = extract_typed_address (buf, builtin_type_void_func_ptr);
   return 1;
 }
 \f
@@ -922,7 +857,7 @@ static CORE_ADDR
 i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
                     int struct_return, CORE_ADDR struct_addr)
 {
-  sp = default_push_arguments (nargs, args, sp, struct_return, struct_addr);
+  sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr);
   
   if (struct_return)
     {
@@ -936,12 +871,6 @@ i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
   return sp;
 }
 
-static void
-i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-{
-  /* Do nothing.  Everything was already done by i386_push_arguments.  */
-}
-
 /* These registers are used for returning integers (and on some
    targets also for returning `struct' and `union' values when their
    size and alignment match an integer type).  */
@@ -969,7 +898,7 @@ i386_extract_return_value (struct type *type, struct regcache *regcache,
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
     {
-      if (FP0_REGNUM == 0)
+      if (FP0_REGNUM < 0)
        {
          warning ("Cannot find floating-point return value.");
          memset (valbuf, 0, len);
@@ -1027,7 +956,7 @@ i386_store_return_value (struct type *type, struct regcache *regcache,
       ULONGEST fstat;
       char buf[FPU_REG_RAW_SIZE];
 
-      if (FP0_REGNUM == 0)
+      if (FP0_REGNUM < 0)
        {
          warning ("Cannot set floating-point return value.");
          return;
@@ -1126,7 +1055,7 @@ i386_use_struct_convention (int gcc_p, struct type *type)
    potentially they could be used for things other than address.  */
 
 static struct type *
-i386_register_virtual_type (int regnum)
+i386_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
     return lookup_pointer_type (builtin_type_void);
@@ -1144,19 +1073,21 @@ i386_register_virtual_type (int regnum)
 }
 
 /* Map a cooked register onto a raw register or memory.  For the i386,
-   the MMX registers need to be mapped onto floating point registers.  */
+   the MMX registers need to be mapped onto floating-point registers.  */
 
 static int
-mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
+i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
 {
   int mmxi;
   ULONGEST fstat;
   int tos;
   int fpi;
+
   mmxi = regnum - MM0_REGNUM;
   regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat);
   tos = (fstat >> 11) & 0x7;
   fpi = (mmxi + tos) % 8;
+
   return (FP0_REGNUM + fpi);
 }
 
@@ -1167,9 +1098,10 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
   if (i386_mmx_regnum_p (regnum))
     {
       char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
-      int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
-      regcache_raw_read (regcache, fpnum, mmx_buf);
+      int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
+
       /* Extract (always little endian).  */
+      regcache_raw_read (regcache, fpnum, mmx_buf);
       memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum));
     }
   else
@@ -1183,7 +1115,8 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
   if (i386_mmx_regnum_p (regnum))
     {
       char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
-      int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
+      int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
+
       /* Read ...  */
       regcache_raw_read (regcache, fpnum, mmx_buf);
       /* ... Modify ... (always little endian).  */
@@ -1290,7 +1223,7 @@ i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name)
       unsigned long indirect = read_memory_unsigned_integer (pc + 2, 4);
       struct minimal_symbol *indsym =
        indirect ? lookup_minimal_symbol_by_pc (indirect) : 0;
-      char *symname = indsym ? SYMBOL_NAME (indsym) : 0;
+      char *symname = indsym ? SYMBOL_LINKAGE_NAME (indsym) : 0;
 
       if (symname)
        {
@@ -1368,8 +1301,8 @@ i386_svr4_sigcontext_addr (struct frame_info *frame)
 
   gdb_assert (sigcontext_offset != -1);
 
-  if (frame->next)
-    return frame->next->frame + sigcontext_offset;
+  if (get_next_frame (frame))
+    return get_frame_base (get_next_frame (frame)) + sigcontext_offset;
   return read_register (SP_REGNUM) + sigcontext_offset;
 }
 \f
@@ -1407,9 +1340,6 @@ i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 
-  /* FIXME: kettenis/20020511: Why do we override this function here?  */
-  set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
-
   set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp);
   tdep->sigcontext_addr = i386_svr4_sigcontext_addr;
   tdep->sc_pc_offset = 14 * 4;
@@ -1437,9 +1367,6 @@ i386_nw_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  /* FIXME: kettenis/20020511: Why do we override this function here?  */
-  set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
-
   tdep->jb_pc_offset = 24;
 }
 \f
@@ -1499,22 +1426,11 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   struct gdbarch_tdep *tdep;
   struct gdbarch *gdbarch;
-  enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
-
-  /* Try to determine the OS ABI of the object we're loading.  */
-  if (info.abfd != NULL)
-    osabi = gdbarch_lookup_osabi (info.abfd);
 
-  /* Find a candidate among extant architectures.  */
-  for (arches = gdbarch_list_lookup_by_info (arches, &info);
-       arches != NULL;
-       arches = gdbarch_list_lookup_by_info (arches->next, &info))
-    {
-      /* Make sure the OS ABI selection matches.  */
-      tdep = gdbarch_tdep (arches->gdbarch);
-      if (tdep && tdep->osabi == osabi)
-        return arches->gdbarch;
-    }
+  /* If there is already a candidate, use it.  */
+  arches = gdbarch_list_lookup_by_info (arches, &info);
+  if (arches != NULL)
+    return arches->gdbarch;
 
   /* Allocate space for the new architecture.  */
   tdep = XMALLOC (struct gdbarch_tdep);
@@ -1524,8 +1440,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      ready to unwind the PC first (see frame.c:get_prev_frame()).  */
   set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
 
-  tdep->osabi = osabi;
-
   /* The i386 default settings don't include the SSE registers.
      FIXME: kettenis/20020614: They do include the FPU registers for
      now, which probably is not quite right.  */
@@ -1574,25 +1488,15 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_name (gdbarch, i386_register_name);
   set_gdbarch_register_size (gdbarch, 4);
   set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
-  set_gdbarch_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE);
-  set_gdbarch_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE);
-  set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type);
+  set_gdbarch_register_type (gdbarch, i386_register_type);
 
   set_gdbarch_print_float_info (gdbarch, i387_print_float_info);
 
   set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
 
   /* Call dummy code.  */
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
-  set_gdbarch_call_dummy_start_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
-  set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_words (gdbarch, NULL);
   set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
-  set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
-  set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
 
   set_gdbarch_register_convertible (gdbarch, i386_register_convertible);
   set_gdbarch_register_convert_to_virtual (gdbarch,
@@ -1605,17 +1509,15 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_parm_boundary (gdbarch, 32);
 
   set_gdbarch_extract_return_value (gdbarch, i386_extract_return_value);
-  set_gdbarch_push_arguments (gdbarch, i386_push_arguments);
-  set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
-  set_gdbarch_push_return_address (gdbarch, i386_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, i386_pop_frame);
-  set_gdbarch_store_struct_return (gdbarch, i386_store_struct_return);
+  set_gdbarch_deprecated_push_arguments (gdbarch, i386_push_arguments);
+  set_gdbarch_deprecated_push_return_address (gdbarch, i386_push_return_address);
+  set_gdbarch_deprecated_pop_frame (gdbarch, i386_pop_frame);
   set_gdbarch_store_return_value (gdbarch, i386_store_return_value);
   set_gdbarch_extract_struct_value_address (gdbarch,
                                            i386_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, i386_use_struct_convention);
 
-  set_gdbarch_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs);
+  set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs);
   set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue);
 
   /* Stack grows downward.  */
@@ -1633,15 +1535,14 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_args_skip (gdbarch, 8);
   set_gdbarch_frameless_function_invocation (gdbarch,
                                            i386_frameless_function_invocation);
-  set_gdbarch_frame_chain (gdbarch, i386_frame_chain);
-  set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
-  set_gdbarch_frame_saved_pc (gdbarch, i386_frame_saved_pc);
-  set_gdbarch_saved_pc_after_call (gdbarch, i386_saved_pc_after_call);
-  set_gdbarch_frame_num_args (gdbarch, i386_frame_num_args);
+  set_gdbarch_deprecated_frame_chain (gdbarch, i386_frame_chain);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_frame_saved_pc);
+  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, i386_saved_pc_after_call);
+  set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
   set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp);
 
   /* Wire in the MMX registers.  */
-  set_gdbarch_num_pseudo_regs (gdbarch, mmx_num_regs);
+  set_gdbarch_num_pseudo_regs (gdbarch, i386_num_mmx_regs);
   set_gdbarch_pseudo_register_read (gdbarch, i386_pseudo_register_read);
   set_gdbarch_pseudo_register_write (gdbarch, i386_pseudo_register_write);
 
@@ -1651,8 +1552,11 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   i386_add_reggroups (gdbarch);
   set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p);
 
+  /* Should be using push_dummy_call.  */
+  set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
+
   /* Hook in ABI-specific overrides, if they have been registered.  */
-  gdbarch_init_osabi (info, gdbarch, osabi);
+  gdbarch_init_osabi (info, gdbarch);
 
   return gdbarch;
 }
This page took 0.031657 seconds and 4 git commands to generate.