+i386_print_insn (bfd_vma pc, disassemble_info *info)
+{
+ gdb_assert (disassembly_flavor == att_flavor
+ || disassembly_flavor == intel_flavor);
+
+ /* FIXME: kettenis/20020915: Until disassembler_options is properly
+ constified, cast to prevent a compiler warning. */
+ info->disassembler_options = (char *) disassembly_flavor;
+ info->mach = gdbarch_bfd_arch_info (current_gdbarch)->mach;
+
+ return print_insn_i386 (pc, info);
+}
+\f
+
+/* There are a few i386 architecture variants that differ only
+ slightly from the generic i386 target. For now, we don't give them
+ their own source file, but include them here. As a consequence,
+ they'll always be included. */
+
+/* System V Release 4 (SVR4). */
+
+static int
+i386_svr4_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ return (name && (strcmp ("_sigreturn", name) == 0
+ || strcmp ("_sigacthandler", name) == 0
+ || strcmp ("sigvechandler", name) == 0));
+}
+
+/* Get address of the pushed ucontext (sigcontext) on the stack for
+ all three variants of SVR4 sigtramps. */
+
+static CORE_ADDR
+i386_svr4_sigcontext_addr (struct frame_info *frame)
+{
+ int sigcontext_offset = -1;
+ char *name = NULL;
+
+ find_pc_partial_function (get_frame_pc (frame), &name, NULL, NULL);
+ if (name)
+ {
+ if (strcmp (name, "_sigreturn") == 0)
+ sigcontext_offset = 132;
+ else if (strcmp (name, "_sigacthandler") == 0)
+ sigcontext_offset = 80;
+ else if (strcmp (name, "sigvechandler") == 0)
+ sigcontext_offset = 120;
+ }
+
+ gdb_assert (sigcontext_offset != -1);
+
+ if (get_next_frame (frame))
+ return get_frame_base (get_next_frame (frame)) + sigcontext_offset;
+ return read_register (SP_REGNUM) + sigcontext_offset;
+}
+\f
+
+/* DJGPP. */
+
+static int
+i386_go32_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ /* DJGPP doesn't have any special frames for signal handlers. */
+ return 0;
+}
+\f
+
+/* Generic ELF. */
+
+void
+i386_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ /* We typically use stabs-in-ELF with the DWARF register numbering. */
+ set_gdbarch_stab_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
+}
+
+/* System V Release 4 (SVR4). */
+
+void
+i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* System V Release 4 uses ELF. */
+ 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);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp);
+ tdep->sigcontext_addr = i386_svr4_sigcontext_addr;
+ tdep->sc_pc_offset = 14 * 4;
+ tdep->sc_sp_offset = 7 * 4;
+
+ tdep->jb_pc_offset = 20;
+}
+
+/* DJGPP. */
+
+static void
+i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)