Move gdbserver tdesc header funcs to c file
[deliverable/binutils-gdb.git] / gdb / i386-fbsd-tdep.c
index a08523a63139cccbf7b6456b66313e58253c8a85..ebc75a8d58588fb9252f15d4640880d3217a9c4c 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for FreeBSD/i386.
 
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -28,7 +28,6 @@
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
-#include "bsd-uthread.h"
 #include "fbsd-tdep.h"
 #include "solib-svr4.h"
 
@@ -224,20 +223,6 @@ int i386fbsd_sc_reg_offset[] =
   8 + 16 * 4                   /* %gs */
 };
 
-/* From /usr/src/lib/libc/i386/gen/_setjmp.S.  */
-static int i386fbsd_jmp_buf_reg_offset[] =
-{
-  -1,                          /* %eax */
-  -1,                          /* %ecx */
-  -1,                          /* %edx */
-  1 * 4,                       /* %ebx */
-  2 * 4,                       /* %esp */
-  3 * 4,                       /* %ebp */
-  4 * 4,                       /* %esi */
-  5 * 4,                       /* %edi */
-  0 * 4                                /* %eip */
-};
-
 /* Get XSAVE extended state xcr0 from core dump.  */
 
 uint64_t
@@ -263,14 +248,14 @@ i386fbsd_core_read_xcr0 (bfd *abfd)
            {
              warning (_("Couldn't read `xcr0' bytes from "
                         "`.reg-xstate' section in core file."));
-             return 0;
+             return X86_XSTATE_SSE_MASK;
            }
 
          xcr0 = bfd_get_64 (abfd, contents);
        }
     }
   else
-    xcr0 = 0;
+    xcr0 = X86_XSTATE_SSE_MASK;
 
   return xcr0;
 }
@@ -333,47 +318,7 @@ i386fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 }
 
 static void
-i386fbsd_supply_uthread (struct regcache *regcache,
-                        int regnum, CORE_ADDR addr)
-{
-  gdb_byte buf[4];
-  int i;
-
-  gdb_assert (regnum >= -1);
-
-  for (i = 0; i < ARRAY_SIZE (i386fbsd_jmp_buf_reg_offset); i++)
-    {
-      if (i386fbsd_jmp_buf_reg_offset[i] != -1
-         && (regnum == -1 || regnum == i))
-       {
-         read_memory (addr + i386fbsd_jmp_buf_reg_offset[i], buf, 4);
-         regcache_raw_supply (regcache, i, buf);
-       }
-    }
-}
-
-static void
-i386fbsd_collect_uthread (const struct regcache *regcache,
-                         int regnum, CORE_ADDR addr)
-{
-  gdb_byte buf[4];
-  int i;
-
-  gdb_assert (regnum >= -1);
-
-  for (i = 0; i < ARRAY_SIZE (i386fbsd_jmp_buf_reg_offset); i++)
-    {
-      if (i386fbsd_jmp_buf_reg_offset[i] != -1
-         && (regnum == -1 || regnum == i))
-       {
-         regcache_raw_collect (regcache, i, buf);
-         write_memory (addr + i386fbsd_jmp_buf_reg_offset[i], buf, 4);
-       }
-    }
-}
-
-static void
-i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
@@ -400,21 +345,9 @@ i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->sc_reg_offset = i386fbsd_sc_reg_offset;
   tdep->sc_num_regs = ARRAY_SIZE (i386fbsd_sc_reg_offset);
 
-  /* FreeBSD provides a user-level threads implementation.  */
-  bsd_uthread_set_supply_uthread (gdbarch, i386fbsd_supply_uthread);
-  bsd_uthread_set_collect_uthread (gdbarch, i386fbsd_collect_uthread);
-}
-
-static void
-i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
-{
-  /* It's almost identical to FreeBSD a.out.  */
-  i386fbsdaout_init_abi (info, gdbarch);
-
-  /* Except that it uses ELF.  */
   i386_elf_init_abi (info, gdbarch);
 
-  /* FreeBSD ELF uses SVR4-style shared libraries.  */
+  /* FreeBSD uses SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 }
@@ -484,15 +417,9 @@ i386fbsd4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                     i386fbsd_core_read_description);
 }
 
-\f
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_i386fbsd_tdep (void);
-
 void
 _initialize_i386fbsd_tdep (void)
 {
-  gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_AOUT,
-                         i386fbsdaout_init_abi);
-  gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_ELF,
+  gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD,
                          i386fbsd4_init_abi);
 }
This page took 0.024724 seconds and 4 git commands to generate.