/* Target-dependent code for GNU/Linux i386.
- Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ Copyright (C) 2000-2015 Free Software Foundation, Inc.
This file is part of GDB.
#include "record-full.h"
#include "linux-record.h"
-#include <stdint.h>
-
#include "features/i386/i386-linux.c"
#include "features/i386/i386-mmx-linux.c"
#include "features/i386/i386-mpx-linux.c"
enum { i386_syscall_max = 499 };
if (syscall <= i386_syscall_max)
- return syscall;
+ return (enum gdb_syscall) syscall;
else
- return -1;
+ return gdb_sys_no_syscall;
}
/* Parse the arguments of current system call instruction and record
return tdesc_i386_mmx_linux;
}
+/* Similar to i386_supply_fpregset, but use XSAVE extended state. */
+
+static void
+i386_linux_supply_xstateregset (const struct regset *regset,
+ struct regcache *regcache, int regnum,
+ const void *xstateregs, size_t len)
+{
+ i387_supply_xsave (regcache, regnum, xstateregs);
+}
+
+/* Similar to i386_collect_fpregset, but use XSAVE extended state. */
+
+static void
+i386_linux_collect_xstateregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *xstateregs, size_t len)
+{
+ i387_collect_xsave (regcache, regnum, xstateregs, 1);
+}
+
+/* Register set definitions. */
+
+static const struct regset i386_linux_xstateregset =
+ {
+ NULL,
+ i386_linux_supply_xstateregset,
+ i386_linux_collect_xstateregset
+ };
+
/* Iterate over core file register note sections. */
static void
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- cb (".reg", 68, "general-purpose", cb_data);
+ cb (".reg", 68, &i386_gregset, NULL, cb_data);
if (tdep->xcr0 & X86_XSTATE_AVX)
- cb (".reg-xstate", X86_XSTATE_MAX_SIZE, "XSAVE extended state", cb_data);
+ cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
+ &i386_linux_xstateregset, "XSAVE extended state", cb_data);
else if (tdep->xcr0 & X86_XSTATE_SSE)
- cb (".reg-xfp", 512, "extended floating-point", cb_data);
+ cb (".reg-xfp", 512, &i386_fpregset, "extended floating-point",
+ cb_data);
else
- cb (".reg2", 108, "floating-point", cb_data);
+ cb (".reg2", 108, &i386_fpregset, NULL, cb_data);
}
/* Linux kernel shows PC value after the 'int $0x80' instruction even if
set_gdbarch_displaced_step_free_closure (gdbarch,
simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch,
- displaced_step_at_entry_point);
+ linux_displaced_step_location);
/* Functions for 'catch syscall'. */
- set_xml_syscall_file_name (XML_SYSCALL_FILENAME_I386);
+ set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_I386);
set_gdbarch_get_syscall_number (gdbarch,
i386_linux_get_syscall_number);
-
- set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
}
/* Provide a prototype to silence -Wmissing-prototypes. */