+2017-04-04 John Baldwin <jhb@FreeBSD.org>
+
+ * amd64-fbsd-tdep.c: Remove "bsd-uthread.h" include.
+ (amd64fbsd_jmp_buf_reg_offset): Remove.
+ (amd64fbsd_supply_uthread): Remove function.
+ (amd64fbsd_collect_uthread): Remove function.
+ (amd64fbsd_init_abi): Don't set bsd-uthread callbacks.
+ * configure.tgt (i[34567]86-*-freebsd*): Remove bsd-uthread.o.
+ (x86_64-*-freebsd*): Remove bsd-uthread.o.
+ (fbsd-nat.c): Update comment.
+ * i386-fbsd-tdep.c: Remove "bsd-uthread.h" include.
+ (i386fbsd_jmp_buf_reg_offset): Remove.
+ (i386fbsd_supply_uthread): Remove function.
+ (i386fbsd_collect_uthread): Remove function.
+ (i386fbsd_init_abi): Don't set bsd-uthread callbacks.
+
2017-04-04 John Baldwin <jhb@FreeBSD.org>
* Makefile.in (ALL_64_TARGET_OBS): Remove alpha-fbsd-tdep.o.
#include "x86-xstate.h"
#include "amd64-tdep.h"
-#include "bsd-uthread.h"
#include "fbsd-tdep.h"
#include "solib-svr4.h"
-1 /* %gs */
};
-/* From /usr/src/lib/libc/amd64/gen/_setjmp.S. */
-static int amd64fbsd_jmp_buf_reg_offset[] =
-{
- -1, /* %rax */
- 1 * 8, /* %rbx */
- -1, /* %rcx */
- -1, /* %rdx */
- -1, /* %rsi */
- -1, /* %rdi */
- 3 * 8, /* %rbp */
- 2 * 8, /* %rsp */
- -1, /* %r8 ... */
- -1,
- -1,
- -1, /* ... %r11 */
- 4 * 8, /* %r12 ... */
- 5 * 8,
- 6 * 8,
- 7 * 8, /* ... %r15 */
- 0 * 8 /* %rip */
-};
-
/* Implement the core_read_description gdbarch method. */
static const struct target_desc *
&amd64fbsd_xstateregset, "XSAVE extended state", cb_data);
}
-static void
-amd64fbsd_supply_uthread (struct regcache *regcache,
- int regnum, CORE_ADDR addr)
-{
- gdb_byte buf[8];
- int i;
-
- gdb_assert (regnum >= -1);
-
- for (i = 0; i < ARRAY_SIZE (amd64fbsd_jmp_buf_reg_offset); i++)
- {
- if (amd64fbsd_jmp_buf_reg_offset[i] != -1
- && (regnum == -1 || regnum == i))
- {
- read_memory (addr + amd64fbsd_jmp_buf_reg_offset[i], buf, 8);
- regcache_raw_supply (regcache, i, buf);
- }
- }
-}
-
-static void
-amd64fbsd_collect_uthread (const struct regcache *regcache,
- int regnum, CORE_ADDR addr)
-{
- gdb_byte buf[8];
- int i;
-
- gdb_assert (regnum >= -1);
-
- for (i = 0; i < ARRAY_SIZE (amd64fbsd_jmp_buf_reg_offset); i++)
- {
- if (amd64fbsd_jmp_buf_reg_offset[i] != -1
- && (regnum == -1 || regnum == i))
- {
- regcache_raw_collect (regcache, i, buf);
- write_memory (addr + amd64fbsd_jmp_buf_reg_offset[i], buf, 8);
- }
- }
-}
-
static void
amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
set_gdbarch_core_read_description (gdbarch,
amd64fbsd_core_read_description);
- /* FreeBSD provides a user-level threads implementation. */
- bsd_uthread_set_supply_uthread (gdbarch, amd64fbsd_supply_uthread);
- bsd_uthread_set_collect_uthread (gdbarch, amd64fbsd_collect_uthread);
-
/* FreeBSD uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets);
i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
# Target: FreeBSD/i386
gdb_target_obs="i386-tdep.o i387-tdep.o i386-bsd-tdep.o i386-fbsd-tdep.o \
- bsd-uthread.o fbsd-tdep.o solib-svr4.o"
+ fbsd-tdep.o solib-svr4.o"
;;
i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
# Target: NetBSD/i386
# Target: FreeBSD/amd64
gdb_target_obs="amd64-tdep.o amd64-fbsd-tdep.o i386-tdep.o \
i387-tdep.o i386-bsd-tdep.o i386-fbsd-tdep.o \
- bsd-uthread.o fbsd-tdep.o solib-svr4.o"
+ fbsd-tdep.o solib-svr4.o"
;;
x86_64-*-mingw* | x86_64-*-cygwin*)
# Target: MingW/amd64
FreeBSD's first thread support was via a "reentrant" version of libc
(libc_r) that first shipped in 2.2.7. This library multiplexed all
of the threads in a process onto a single kernel thread. This
- library is supported via the bsd-uthread target.
+ library was supported via the bsd-uthread target.
FreeBSD 5.1 introduced two new threading libraries that made use of
multiple kernel threads. The first (libkse) scheduled M user
#include "i386-tdep.h"
#include "i387-tdep.h"
-#include "bsd-uthread.h"
#include "fbsd-tdep.h"
#include "solib-svr4.h"
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
&i386fbsd_xstateregset, "XSAVE extended state", cb_data);
}
-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
i386fbsd_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);
-
i386_elf_init_abi (info, gdbarch);
/* FreeBSD uses SVR4-style shared libraries. */