+2010-04-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * i386-linux-nat.c (have_ptrace_getfpxregs): Initialize to -1
+ if HAVE_PTRACE_GETFPXREGS is defined.
+ (i386_linux_read_description): Set have_ptrace_getfpxregs and
+ have_ptrace_getregset to 0 if ptrace PTRACE_GETFPXREGS failed.
+
+ * i386-linux-tdep.c: Include "features/i386/i386-mmx-linux.c"
+ (i386_linux_core_read_description): Return tdesc_i386_mmx_linux
+ if .reg-xfp section doesn't exist.
+ (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_mmx_linux.
+
+ * i386-linux-tdep.h (tdesc_i386_mmx_linux): New.
+
+ * i386-tdep.c: Include "features/i386/i386-mmx.c".
+ (i386_go32_init_abi): Set tdesc to tdesc_i386_mmx.
+ (i386_validate_tdesc_p): Make org.gnu.gdb.i386.sse optional. Set
+ xcr0 to I386_XSTATE_X87_MASK if SSE isn't available.
+ (i386_gdbarch_init): Update comments.
+ (_initialize_i386_tdep): Call initialize_tdesc_i386_mmx.
+
+ * common/i386-xstate.h (I386_XSTATE_X87_MASK): New.
+
+ * config/djgpp/fnchange.lst: Add i386 MMX XML files.
+
+ * features/Makefile (i386/i386-mmx-expedite): New.
+ (i386/i386-mmx-linux-expedite): Likewise.
+ ($(outdir)/i386/i386-mmx.dat): Likewise.
+ ($(outdir)/i386/i386-mmx-linux.dat): Likewise.
+
+ * features/i386/i386-mmx-linux.c: New.
+ * features/i386/i386-mmx-linux.xml: Likewise.
+ * features/i386/i386-mmx.c: Likewise.
+ * features/i386/i386-mmx.xml: Likewise.
+ * regformats/i386/i386-mmx-linux.dat: Likewise.
+ * regformats/i386/i386-mmx.dat: Likewise.
+
+ * features/Makefile (WHICH): Add i386/i386-mmx and
+ i386/i386-mmx-linux.
+
2010-04-08 Doug Evans <dje@google.com>
* source.c (openp): Skip $cdir in PATH.
2010-04-08 Phil Muldoon <pmuldoon@redhat.com>
PR python/11417
-
* python/py-lazy-string.c (stpy_convert_to_value): Check for
- a NULL address.
- (gdbpy_create_lazy_string_object): Allow strings with a NULL
- address and a zero length.
+ a NULL address.
+ (gdbpy_create_lazy_string_object): Allow strings with a NULL
+ address and a zero length.
2010-04-08 Hui Zhu <teawater@gmail.com>
#define I386_XSTATE_AVX (1ULL << 2)
/* Supported mask and size of the extended state. */
+#define I386_XSTATE_X87_MASK I386_XSTATE_X87
#define I386_XSTATE_SSE_MASK (I386_XSTATE_X87 | I386_XSTATE_SSE)
#define I386_XSTATE_AVX_MASK (I386_XSTATE_SSE_MASK | I386_XSTATE_AVX)
@V@/gdb/features/i386/i386-avx.c @V@/gdb/features/i386/i32-a.c
@V@/gdb/features/i386/i386-avx-linux.xml @V@/gdb/features/i386/i32-al.xml
@V@/gdb/features/i386/i386-avx.xml @V@/gdb/features/i386/i32-a.xml
+@V@/gdb/features/i386/i386-mmx-linux.c @V@/features/i386/i32-ml.c
+@V@/gdb/features/i386/i386-mmx.c @V@/gdb/features/i386/i32-m.c
+@V@/gdb/features/i386/i386-mmx-linux.xml @V@/gdb/features/i386/i32-ml.xml
+@V@/gdb/features/i386/i386-mmx.xml @V@/gdb/features/i386/i32-m.xml
@V@/gdb/f-exp.tab.c @V@/gdb/f-exp_tab.c
@V@/gdb/gdbserver/linux-cris-low.c @V@/gdb/gdbserver/lx-cris.c
@V@/gdb/gdbserver/linux-crisv32-low.c @V@/gdb/gdbserver/lx-cris32.c
+2010-04-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gdb.texinfo (i386 Features): Make org.gnu.gdb.i386.avx
+ optional. Make org.gnu.gdb.i386.avx requires
+ org.gnu.gdb.i386.avx.
+
2010-04-08 Doug Evans <dje@google.com>
* gdb.texinfo (Command Files): Document that gdb skips $cdir in
The register sets may be different, depending on the target.
-The @samp{org.gnu.gdb.i386.sse} feature is required. It should
+The @samp{org.gnu.gdb.i386.sse} feature is optional. It should
describe registers:
@itemize @minus
@samp{mxcsr}
@end itemize
-The @samp{org.gnu.gdb.i386.avx} feature is optional. It should
+The @samp{org.gnu.gdb.i386.avx} feature is optional and requires the
+@samp{org.gnu.gdb.i386.sse} feature. It should
describe the upper 128 bits of @sc{ymm} registers:
@itemize @minus
WHICH = arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
i386/i386 i386/i386-linux \
+ i386/i386-mmx i386/i386-mmx-linux \
i386/amd64 i386/amd64-linux \
i386/i386-avx i386/i386-avx-linux \
i386/amd64-avx i386/amd64-avx-linux \
i386/amd64-linux-expedite = rbp,rsp,rip
i386/i386-avx-expedite = ebp,esp,eip
i386/i386-avx-linux-expedite = ebp,esp,eip
+i386/i386-mmx-expedite = ebp,esp,eip
+i386/i386-mmx-linux-expedite = ebp,esp,eip
i386/amd64-avx-expedite = rbp,rsp,rip
i386/amd64-avx-linux-expedite = rbp,rsp,rip
mips-expedite = r29,pc
$(outdir)/i386/i386-avx.dat: i386/32bit-core.xml i386/32bit-avx.xml
$(outdir)/i386/i386-avx-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
i386/32bit-linux.xml
+$(outdir)/i386/i386-mmx.dat: i386/32bit-core.xml
+$(outdir)/i386/i386-mmx-linux.dat: i386/32bit-core.xml i386/32bit-linux.xml
$(outdir)/i386/amd64-avx.dat: i386/64bit-core.xml i386/64bit-avx.xml
$(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
i386/64bit-linux.xml
--- /dev/null
+/* THIS FILE IS GENERATED. Original: i386-mmx-linux.xml */
+
+#include "defs.h"
+#include "osabi.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_i386_mmx_linux;
+static void
+initialize_tdesc_i386_mmx_linux (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct tdesc_type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("i386"));
+
+ set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
+ tdesc_add_flag (field_type, 0, "CF");
+ tdesc_add_flag (field_type, 1, "");
+ tdesc_add_flag (field_type, 2, "PF");
+ tdesc_add_flag (field_type, 4, "AF");
+ tdesc_add_flag (field_type, 6, "ZF");
+ tdesc_add_flag (field_type, 7, "SF");
+ tdesc_add_flag (field_type, 8, "TF");
+ tdesc_add_flag (field_type, 9, "IF");
+ tdesc_add_flag (field_type, 10, "DF");
+ tdesc_add_flag (field_type, 11, "OF");
+ tdesc_add_flag (field_type, 14, "NT");
+ tdesc_add_flag (field_type, 16, "RF");
+ tdesc_add_flag (field_type, 17, "VM");
+ tdesc_add_flag (field_type, 18, "AC");
+ tdesc_add_flag (field_type, 19, "VIF");
+ tdesc_add_flag (field_type, 20, "VIP");
+ tdesc_add_flag (field_type, 21, "ID");
+
+ tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ebx", 3, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "esp", 4, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "ebp", 5, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "esi", 6, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "edi", 7, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "eip", 8, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "eflags", 9, 1, NULL, 32, "i386_eflags");
+ tdesc_create_reg (feature, "cs", 10, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ss", 11, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ds", 12, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "es", 13, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "fs", 14, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "gs", 15, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "st0", 16, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st1", 17, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st2", 18, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st3", 19, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st4", 20, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st5", 21, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st6", 22, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st7", 23, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "fctrl", 24, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fstat", 25, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "ftag", 26, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fiseg", 27, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fioff", 28, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "foseg", 29, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fooff", 30, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fop", 31, 1, "float", 32, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
+ tdesc_create_reg (feature, "orig_eax", 41, 1, NULL, 32, "int");
+
+ tdesc_i386_mmx_linux = result;
+}
--- /dev/null
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- I386 with MMX - Includes Linux-only special "register". -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>i386</architecture>
+ <osabi>GNU/Linux</osabi>
+ <xi:include href="32bit-core.xml"/>
+ <xi:include href="32bit-linux.xml"/>
+</target>
--- /dev/null
+/* THIS FILE IS GENERATED. Original: i386-mmx.xml */
+
+#include "defs.h"
+#include "osabi.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_i386_mmx;
+static void
+initialize_tdesc_i386_mmx (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct tdesc_type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("i386"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
+ tdesc_add_flag (field_type, 0, "CF");
+ tdesc_add_flag (field_type, 1, "");
+ tdesc_add_flag (field_type, 2, "PF");
+ tdesc_add_flag (field_type, 4, "AF");
+ tdesc_add_flag (field_type, 6, "ZF");
+ tdesc_add_flag (field_type, 7, "SF");
+ tdesc_add_flag (field_type, 8, "TF");
+ tdesc_add_flag (field_type, 9, "IF");
+ tdesc_add_flag (field_type, 10, "DF");
+ tdesc_add_flag (field_type, 11, "OF");
+ tdesc_add_flag (field_type, 14, "NT");
+ tdesc_add_flag (field_type, 16, "RF");
+ tdesc_add_flag (field_type, 17, "VM");
+ tdesc_add_flag (field_type, 18, "AC");
+ tdesc_add_flag (field_type, 19, "VIF");
+ tdesc_add_flag (field_type, 20, "VIP");
+ tdesc_add_flag (field_type, 21, "ID");
+
+ tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ebx", 3, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "esp", 4, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "ebp", 5, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "esi", 6, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "edi", 7, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "eip", 8, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "eflags", 9, 1, NULL, 32, "i386_eflags");
+ tdesc_create_reg (feature, "cs", 10, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ss", 11, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "ds", 12, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "es", 13, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "fs", 14, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "gs", 15, 1, NULL, 32, "int32");
+ tdesc_create_reg (feature, "st0", 16, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st1", 17, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st2", 18, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st3", 19, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st4", 20, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st5", 21, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st6", 22, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "st7", 23, 1, NULL, 80, "i387_ext");
+ tdesc_create_reg (feature, "fctrl", 24, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fstat", 25, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "ftag", 26, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fiseg", 27, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fioff", 28, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "foseg", 29, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fooff", 30, 1, "float", 32, "int");
+ tdesc_create_reg (feature, "fop", 31, 1, "float", 32, "int");
+
+ tdesc_i386_mmx = result;
+}
--- /dev/null
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- I386 with MMX -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>i386</architecture>
+ <xi:include href="32bit-core.xml"/>
+</target>
+2010-04-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
+ (i386-mmx.o): New.
+ (i386-mmx.c): Likewise.
+ (i386-mmx-linux.o): Likewise.
+ (i386-mmx-linux.c): Likewise.
+
+ * configure.srv (srv_i386_regobj): Add i386-mmx.o.
+ (srv_i386_linux_regobj): Add i386-mmx-linux.o.
+ (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
+ (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
+
+ * linux-x86-low.c (init_registers_i386_mmx_linux): New.
+ (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
+ and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
+
2010-04-07 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (clean): Updated.
rm -f xml-builtin.c stamp-xml
rm -f i386-avx.c i386-avx-linux.c
rm -f amd64-avx.c amd64-avx-linux.c
+ rm -f i386-mmx.c i386-mmx-linux.c
maintainer-clean realclean distclean: clean
rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
i386-avx-linux.o : i386-avx-linux.c $(regdef_h)
i386-avx-linux.c : $(srcdir)/../regformats/i386/i386-avx-linux.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-avx-linux.dat i386-avx-linux.c
+i386-mmx.o : i386-mmx.c $(regdef_h)
+i386-mmx.c : $(srcdir)/../regformats/i386/i386-mmx.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mmx.dat i386-mmx.c
+i386-mmx-linux.o : i386-mmx-linux.c $(regdef_h)
+i386-mmx-linux.c : $(srcdir)/../regformats/i386/i386-mmx-linux.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mmx-linux.dat i386-mmx-linux.c
reg-ia64.o : reg-ia64.c $(regdef_h)
reg-ia64.c : $(srcdir)/../regformats/reg-ia64.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-ia64.dat reg-ia64.c
# Default hostio_last_error implementation
srv_hostio_err_objs="hostio-errno.o"
-srv_i386_regobj="i386.o i386-avx.o"
-srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o"
+srv_i386_regobj="i386.o i386-avx.o i386-mmx.o"
+srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o i386-mmx-linux.o"
srv_amd64_regobj="amd64.o x86-64-avx.o"
srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o"
srv_i386_32bit_xmlfiles="i386/32bit-core.xml i386/32bit-sse.xml i386/32bit-avx.xml"
srv_i386_64bit_xmlfiles="i386/64bit-core.xml i386/64bit-sse.xml i386/64bit-avx.xml"
-srv_i386_xmlfiles="i386/i386.xml i386/i386-avx.xml $srv_i386_32bit_xmlfiles"
+srv_i386_xmlfiles="i386/i386.xml i386/i386-avx.xml i386/i386-mmx.xml $srv_i386_32bit_xmlfiles"
srv_amd64_xmlfiles="i386/amd64.xml i386/amd64-avx.xml $srv_i386_64bit_xmlfiles"
-srv_i386_linux_xmlfiles="i386/i386-linux.xml i386/i386-avx-linux.xml i386/32bit-linux.xml $srv_i386_32bit_xmlfiles"
+srv_i386_linux_xmlfiles="i386/i386-linux.xml i386/i386-avx-linux.xml i386/i386-mmx-linux.xml i386/32bit-linux.xml $srv_i386_32bit_xmlfiles"
srv_amd64_linux_xmlfiles="i386/amd64-linux.xml i386/amd64-avx-linux.xml i386/64bit-linux.xml $srv_i386_64bit_xmlfiles"
# Input is taken from the "${target}" variable.
void init_registers_i386_avx_linux (void);
/* Defined in auto-generated file amd64-avx-linux.c. */
void init_registers_amd64_avx_linux (void);
+/* Defined in auto-generated file i386-mmx-linux.c. */
+void init_registers_i386_mmx_linux (void);
/* Backward compatibility for gdb without XML support. */
static void
x86_linux_update_xmltarget (void)
{
+ int pid;
+ struct regset_info *regset;
static unsigned long long xcr0;
static int have_ptrace_getregset = -1;
+#ifdef HAVE_PTRACE_GETFPXREGS
+ static int have_ptrace_getfpxregs = -1;
+#endif
if (!current_inferior)
return;
+ pid = pid_of (get_thread_lwp (current_inferior));
#ifdef __x86_64__
if (num_xmm_registers == 8)
init_registers_i386_linux ();
else
init_registers_amd64_linux ();
#else
- init_registers_i386_linux ();
+ {
+# ifdef HAVE_PTRACE_GETFPXREGS
+ if (have_ptrace_getfpxregs == -1)
+ {
+ elf_fpxregset_t fpxregs;
+
+ if (ptrace (PTRACE_GETFPXREGS, pid, 0, (int) &fpxregs) < 0)
+ {
+ have_ptrace_getfpxregs = 0;
+ x86_xcr0 = I386_XSTATE_X87_MASK;
+
+ /* Disable PTRACE_GETFPXREGS. */
+ for (regset = target_regsets;
+ regset->fill_function != NULL; regset++)
+ if (regset->get_request == PTRACE_GETFPXREGS)
+ {
+ regset->size = 0;
+ break;
+ }
+ }
+ else
+ have_ptrace_getfpxregs = 1;
+ }
+
+ if (!have_ptrace_getfpxregs)
+ {
+ init_registers_i386_mmx_linux ();
+ return;
+ }
+# endif
+ init_registers_i386_linux ();
+ }
#endif
if (!use_xml)
/* Check if XSAVE extended state is supported. */
if (have_ptrace_getregset == -1)
{
- int pid = pid_of (get_thread_lwp (current_inferior));
unsigned long long xstateregs[I386_XSTATE_SSE_SIZE / sizeof (long long)];
struct iovec iov;
- struct regset_info *regset;
iov.iov_base = xstateregs;
iov.iov_len = sizeof (xstateregs);
for this to be a simple variable. */
int have_ptrace_getfpxregs =
#ifdef HAVE_PTRACE_GETFPXREGS
- 1
+ -1
#else
0
#endif
static const struct target_desc *
i386_linux_read_description (struct target_ops *ops)
{
+ int tid;
static uint64_t xcr0;
+ /* GNU/Linux LWP ID's are process ID's. */
+ tid = TIDGET (inferior_ptid);
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+
+#ifdef HAVE_PTRACE_GETFPXREGS
+ if (have_ptrace_getfpxregs == -1)
+ {
+ elf_fpxregset_t fpxregs;
+
+ if (ptrace (PTRACE_GETFPXREGS, tid, 0, (int) &fpxregs) < 0)
+ {
+ have_ptrace_getfpxregs = 0;
+ have_ptrace_getregset = 0;
+ return tdesc_i386_mmx_linux;
+ }
+ }
+#endif
+
if (have_ptrace_getregset == -1)
{
- int tid;
uint64_t xstateregs[(I386_XSTATE_SSE_SIZE / sizeof (uint64_t))];
struct iovec iov;
- /* GNU/Linux LWP ID's are process ID's. */
- tid = TIDGET (inferior_ptid);
- if (tid == 0)
- tid = PIDGET (inferior_ptid); /* Not a threaded program. */
-
iov.iov_base = xstateregs;
iov.iov_len = sizeof (xstateregs);
#include <stdint.h>
#include "features/i386/i386-linux.c"
+#include "features/i386/i386-mmx-linux.c"
#include "features/i386/i386-avx-linux.c"
/* Supported register note sections. */
if (section == NULL)
return NULL;
+ section = bfd_get_section_by_name (abfd, ".reg-xfp");
+ if (section == NULL)
+ return tdesc_i386_mmx_linux;
+
/* Linux/i386. */
xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd);
if ((xcr0 & I386_XSTATE_AVX_MASK) == I386_XSTATE_AVX_MASK)
/* Initialize the Linux target description */
initialize_tdesc_i386_linux ();
+ initialize_tdesc_i386_mmx_linux ();
initialize_tdesc_i386_avx_linux ();
}
/* Linux target description. */
extern struct target_desc *tdesc_i386_linux;
+extern struct target_desc *tdesc_i386_mmx_linux;
extern struct target_desc *tdesc_i386_avx_linux;
/* Format of XSAVE extended state is:
#include "features/i386/i386.c"
#include "features/i386/i386-avx.c"
+#include "features/i386/i386-mmx.c"
/* Register names. */
tdep->jb_pc_offset = 36;
/* DJGPP does not support the SSE registers. */
- tdep->num_xmm_regs = 0;
- set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I387_NUM_REGS);
+ if (! tdesc_has_registers (info.target_desc))
+ tdep->tdesc = tdesc_i386_mmx;
/* Native compiler is GCC, which uses the SVR4 register numbering
even in COFF and STABS. See the comment in i386_gdbarch_init,
/* Get core registers. */
feature_core = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.core");
+ if (feature_core == NULL)
+ return 0;
/* Get SSE registers. */
feature_sse = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.sse");
- if (feature_core == NULL || feature_sse == NULL)
- return 0;
-
/* Try AVX registers. */
feature_avx = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.avx");
/* The XCR0 bits. */
if (feature_avx)
{
+ /* AVX register description requires SSE register description. */
+ if (!feature_sse)
+ return 0;
+
tdep->xcr0 = I386_XSTATE_AVX_MASK;
/* It may have been set by OSABI initialization function. */
tdep->ymm0h_regnum + i,
tdep->ymmh_register_names[i]);
}
- else
+ else if (feature_sse)
tdep->xcr0 = I386_XSTATE_SSE_MASK;
+ else
+ {
+ tdep->xcr0 = I386_XSTATE_X87_MASK;
+ tdep->num_xmm_regs = 0;
+ }
num_regs = tdep->num_core_regs;
for (i = 0; i < num_regs; i++)
valid_p &= tdesc_numbered_register (feature_core, tdesc_data, i,
tdep->register_names[i]);
- /* Need to include %mxcsr, so add one. */
- num_regs += tdep->num_xmm_regs + 1;
- for (; i < num_regs; i++)
- valid_p &= tdesc_numbered_register (feature_sse, tdesc_data, i,
- tdep->register_names[i]);
+ if (feature_sse)
+ {
+ /* Need to include %mxcsr, so add one. */
+ num_regs += tdep->num_xmm_regs + 1;
+ for (; i < num_regs; i++)
+ valid_p &= tdesc_numbered_register (feature_sse, tdesc_data, i,
+ tdep->register_names[i]);
+ }
return valid_p;
}
and the SSE registers. This can be overridden for a specific ABI
by adjusting the members `st0_regnum', `mm0_regnum' and
`num_xmm_regs' of `struct gdbarch_tdep', otherwise the registers
- will show up in the output of "info all-registers". Ideally we
- should try to autodetect whether they are available, such that we
- can prevent "info all-registers" from displaying registers that
- aren't available.
-
- NOTE: kevinb/2003-07-13: ... if it's a choice between printing
- [the SSE registers] always (even when they don't exist) or never
- showing them to the user (even when they do exist), I prefer the
- former over the latter. */
+ will show up in the output of "info all-registers". */
tdep->st0_regnum = I386_ST0_REGNUM;
/* Initialize the standard target descriptions. */
initialize_tdesc_i386 ();
+ initialize_tdesc_i386_mmx ();
initialize_tdesc_i386_avx ();
/* Tell remote stub that we support XML target description. */
--- /dev/null
+# DO NOT EDIT: generated from i386/i386-mmx-linux.xml
+name:i386_mmx_linux
+xmltarget:i386-mmx-linux.xml
+expedite:ebp,esp,eip
+32:eax
+32:ecx
+32:edx
+32:ebx
+32:esp
+32:ebp
+32:esi
+32:edi
+32:eip
+32:eflags
+32:cs
+32:ss
+32:ds
+32:es
+32:fs
+32:gs
+80:st0
+80:st1
+80:st2
+80:st3
+80:st4
+80:st5
+80:st6
+80:st7
+32:fctrl
+32:fstat
+32:ftag
+32:fiseg
+32:fioff
+32:foseg
+32:fooff
+32:fop
+0:
+0:
+0:
+0:
+0:
+0:
+0:
+0:
+0:
+32:orig_eax
--- /dev/null
+# DO NOT EDIT: generated from i386/i386-mmx.xml
+name:i386_mmx
+xmltarget:i386-mmx.xml
+expedite:ebp,esp,eip
+32:eax
+32:ecx
+32:edx
+32:ebx
+32:esp
+32:ebp
+32:esi
+32:edi
+32:eip
+32:eflags
+32:cs
+32:ss
+32:ds
+32:es
+32:fs
+32:gs
+80:st0
+80:st1
+80:st2
+80:st3
+80:st4
+80:st5
+80:st6
+80:st7
+32:fctrl
+32:fstat
+32:ftag
+32:fiseg
+32:fioff
+32:foseg
+32:fooff
+32:fop