+const struct regset i386_gregset =
+ {
+ NULL, i386_supply_gregset, i386_collect_gregset
+ };
+
+const struct regset i386_fpregset =
+ {
+ NULL, i386_supply_fpregset, i386_collect_fpregset
+ };
+
+/* Default iterator over core file register note sections. */
+
+void
+i386_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
+ if (tdep->sizeof_fpregset)
+ cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
+}
+\f
+
+/* Stuff for WIN32 PE style DLL's but is pretty generic really. */
+
+CORE_ADDR
+i386_pe_skip_trampoline_code (struct frame_info *frame,
+ CORE_ADDR pc, char *name)
+{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
+ /* jmp *(dest) */
+ if (pc && read_memory_unsigned_integer (pc, 2, byte_order) == 0x25ff)
+ {
+ unsigned long indirect =
+ read_memory_unsigned_integer (pc + 2, 4, byte_order);
+ struct minimal_symbol *indsym =
+ indirect ? lookup_minimal_symbol_by_pc (indirect).minsym : 0;
+ const char *symname = indsym ? MSYMBOL_LINKAGE_NAME (indsym) : 0;
+
+ if (symname)
+ {
+ if (strncmp (symname, "__imp_", 6) == 0
+ || strncmp (symname, "_imp_", 5) == 0)
+ return name ? 1 :
+ read_memory_unsigned_integer (indirect, 4, byte_order);
+ }
+ }
+ return 0; /* Not a trampoline. */
+}
+\f
+
+/* Return whether the THIS_FRAME corresponds to a sigtramp
+ routine. */
+
+int
+i386_sigtramp_p (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ const char *name;
+
+ find_pc_partial_function (pc, &name, NULL, NULL);
+ return (name && strcmp ("_sigtramp", name) == 0);
+}
+\f
+
+/* We have two flavours of disassembly. The machinery on this page
+ deals with switching between those. */
+
+static int
+i386_print_insn (bfd_vma pc, struct 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;
+
+ 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). */
+
+/* Return whether THIS_FRAME corresponds to a SVR4 sigtramp
+ routine. */
+
+static int
+i386_svr4_sigtramp_p (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ const char *name;
+
+ /* The origin of these symbols is currently unknown. */
+ find_pc_partial_function (pc, &name, NULL, NULL);
+ return (name && (strcmp ("_sigreturn", name) == 0
+ || strcmp ("sigvechandler", name) == 0));
+}
+
+/* Assuming THIS_FRAME is for a SVR4 sigtramp routine, return the
+ address of the associated sigcontext (ucontext) structure. */
+
+static CORE_ADDR
+i386_svr4_sigcontext_addr (struct frame_info *this_frame)