/* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of GDB.
#include "nat/x86-linux-dregs.h"
#include "nat/linux-ptrace.h"
-/* Per-thread arch-specific data we want to keep. */
-
-struct arch_lwp_info
-{
- /* Non-zero if our copy differs from what's recorded in the thread. */
- int debug_registers_changed;
-};
-
-\f
-
/* linux_nat_new_fork hook. */
static void
{
have_ptrace_getfpxregs = 0;
have_ptrace_getregset = TRIBOOL_FALSE;
- return tdesc_i386_mmx_linux;
+ return i386_linux_read_description (X86_XSTATE_X87_MASK);
}
}
#endif
if (is_64bit)
{
#ifdef __x86_64__
- switch (xcr0_features_bits)
- {
- case X86_XSTATE_MPX_AVX512_MASK:
- case X86_XSTATE_AVX512_MASK:
- if (is_x32)
- return tdesc_x32_avx512_linux;
- else
- return tdesc_amd64_avx512_linux;
- case X86_XSTATE_MPX_MASK:
- if (is_x32)
- return tdesc_x32_avx_linux; /* No MPX on x32 using AVX. */
- else
- return tdesc_amd64_mpx_linux;
- case X86_XSTATE_AVX_MASK:
- if (is_x32)
- return tdesc_x32_avx_linux;
- else
- return tdesc_amd64_avx_linux;
- default:
- if (is_x32)
- return tdesc_x32_linux;
- else
- return tdesc_amd64_linux;
- }
+ return amd64_linux_read_description (xcr0_features_bits, is_x32);
#endif
}
else
{
- switch (xcr0_features_bits)
- {
- case X86_XSTATE_MPX_AVX512_MASK:
- case X86_XSTATE_AVX512_MASK:
- return tdesc_i386_avx512_linux;
- case X86_XSTATE_MPX_MASK:
- return tdesc_i386_mpx_linux;
- case X86_XSTATE_AVX_MASK:
- return tdesc_i386_avx_linux;
- default:
- return tdesc_i386_linux;
- }
+ const struct target_desc * tdesc
+ = i386_linux_read_description (xcr0_features_bits);
+
+ if (tdesc == NULL)
+ tdesc = i386_linux_read_description (X86_XSTATE_SSE_MASK);
+
+ return tdesc;
}
gdb_assert_not_reached ("failed to return tdesc");
x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid,
const struct btrace_config *conf)
{
- struct btrace_target_info *tinfo;
- struct gdbarch *gdbarch;
-
- errno = 0;
- tinfo = linux_enable_btrace (ptid, conf);
-
- if (tinfo == NULL)
- error (_("Could not enable branch tracing for %s: %s."),
- target_pid_to_str (ptid), safe_strerror (errno));
+ struct btrace_target_info *tinfo = nullptr;
+ TRY
+ {
+ tinfo = linux_enable_btrace (ptid, conf);
+ }
+ CATCH (exception, RETURN_MASK_ERROR)
+ {
+ error (_("Could not enable branch tracing for %s: %s"),
+ target_pid_to_str (ptid), exception.message);
+ }
+ END_CATCH
return tinfo;
}
t->to_read_description = x86_linux_read_description;
/* Add btrace methods. */
- t->to_supports_btrace = linux_supports_btrace;
t->to_enable_btrace = x86_linux_enable_btrace;
t->to_disable_btrace = x86_linux_disable_btrace;
t->to_teardown_btrace = x86_linux_teardown_btrace;
{
linux_nat_add_target (t);
linux_nat_set_new_thread (t, x86_linux_new_thread);
+ linux_nat_set_delete_thread (t, x86_linux_delete_thread);
linux_nat_set_new_fork (t, x86_linux_new_fork);
linux_nat_set_forget_process (t, x86_forget_process);
linux_nat_set_prepare_to_resume (t, x86_linux_prepare_to_resume);