* config/i386/tm-cygwin.h: Define HAVE_SSE_REGS if
authorChristopher Faylor <me+cygwin@cgf.cx>
Tue, 27 Nov 2001 05:15:58 +0000 (05:15 +0000)
committerChristopher Faylor <me+cygwin@cgf.cx>
Tue, 27 Nov 2001 05:15:58 +0000 (05:15 +0000)
HAVE_CONTEXT_EXTENDED_REGISTERS is defined.
* win32-nat.c: Define CONTEXT_DEBUGGER_DR that will also include extended
registers if HAVE_SSE_REGS is defined.
(mappings array): Add offset of extended registers.
(thread_rec): Use new CONTEXT_DEBUGGER_DR macro.

gdb/ChangeLog
gdb/config/i386/tm-cygwin.h
gdb/win32-nat.c
gdb/windows-nat.c

index a7fb83b..3f4f170 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-26 Pierre Muller  <muller@ics.u-strasbg.fr>
+
+       * config/i386/tm-cygwin.h: Define HAVE_SSE_REGS if
+       HAVE_CONTEXT_EXTENDED_REGISTERS is defined.
+       * win32-nat.c: Define CONTEXT_DEBUGGER_DR that will also include
+       extended registers if HAVE_SSE_REGS is defined.
+       (mappings array): Add offset of extended registers.
+       (thread_rec): Use new CONTEXT_DEBUGGER_DR macro.
+
 2001-11-26  Tom Tromey  <tromey@redhat.com>
 
        * NEWS: Updated.
index 756a6ea..1d49133 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-
-#undef HAVE_SSE_REGS   /* FIXME! win32-nat.c needs to support XMMi registers */
+/* Use SSE registers if winnt.h contains information about them.  */
+#ifdef HAVE_CONTEXT_EXTENDED_REGISTERS
+#define HAVE_SSE_REGS
+#else
+#undef HAVE_SSE_REGS
+#endif /* CONTEXT_EXTENDED_REGISTERS */
 #define HAVE_I387_REGS
 
 #include "i386/tm-i386.h"
index 4b90088..9b9286f 100644 (file)
@@ -25,6 +25,7 @@
 /* We assume we're being built with and will be used for cygwin.  */
 
 #include "defs.h"
+#include "tm.h"                        /* required for SSE registers */
 #include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
@@ -66,6 +67,13 @@ enum
 #include <sys/procfs.h>
 #include <psapi.h>
 
+#ifdef HAVE_SSE_REGS
+#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_EXTENDED_REGISTERS 
+#else
+#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER
+#endif
+
+
 /* The string sent by cygwin when it processes a signal.
    FIXME: This should be in a cygwin include file. */
 #define CYGWIN_SIGNAL_STRING "cygwin: signal"
@@ -169,6 +177,19 @@ static const int mappings[] =
   context_offset (FloatSave.DataSelector),
   context_offset (FloatSave.DataOffset),
   context_offset (FloatSave.ErrorSelector)
+#ifdef HAVE_SSE_REGS
+  /* XMM0-7 */ ,
+  context_offset (ExtendedRegisters[0*16]),
+  context_offset (ExtendedRegisters[1*16]),
+  context_offset (ExtendedRegisters[2*16]),
+  context_offset (ExtendedRegisters[3*16]),
+  context_offset (ExtendedRegisters[4*16]),
+  context_offset (ExtendedRegisters[5*16]),
+  context_offset (ExtendedRegisters[6*16]),
+  context_offset (ExtendedRegisters[7*16]),
+  /* MXCSR untested */
+  context_offset (ExtendedRegisters[8*16])
+#endif
 };
 
 #undef context_offset
@@ -210,7 +231,7 @@ thread_rec (DWORD id, int get_context)
            else if (get_context < 0)
              th->suspend_count = -1;
 
-           th->context.ContextFlags = CONTEXT_DEBUGGER;
+           th->context.ContextFlags = CONTEXT_DEBUGGER_DR;
            GetThreadContext (th->h, &th->context);
          }
        return th;
index 4b90088..9b9286f 100644 (file)
@@ -25,6 +25,7 @@
 /* We assume we're being built with and will be used for cygwin.  */
 
 #include "defs.h"
+#include "tm.h"                        /* required for SSE registers */
 #include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
@@ -66,6 +67,13 @@ enum
 #include <sys/procfs.h>
 #include <psapi.h>
 
+#ifdef HAVE_SSE_REGS
+#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_EXTENDED_REGISTERS 
+#else
+#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER
+#endif
+
+
 /* The string sent by cygwin when it processes a signal.
    FIXME: This should be in a cygwin include file. */
 #define CYGWIN_SIGNAL_STRING "cygwin: signal"
@@ -169,6 +177,19 @@ static const int mappings[] =
   context_offset (FloatSave.DataSelector),
   context_offset (FloatSave.DataOffset),
   context_offset (FloatSave.ErrorSelector)
+#ifdef HAVE_SSE_REGS
+  /* XMM0-7 */ ,
+  context_offset (ExtendedRegisters[0*16]),
+  context_offset (ExtendedRegisters[1*16]),
+  context_offset (ExtendedRegisters[2*16]),
+  context_offset (ExtendedRegisters[3*16]),
+  context_offset (ExtendedRegisters[4*16]),
+  context_offset (ExtendedRegisters[5*16]),
+  context_offset (ExtendedRegisters[6*16]),
+  context_offset (ExtendedRegisters[7*16]),
+  /* MXCSR untested */
+  context_offset (ExtendedRegisters[8*16])
+#endif
 };
 
 #undef context_offset
@@ -210,7 +231,7 @@ thread_rec (DWORD id, int get_context)
            else if (get_context < 0)
              th->suspend_count = -1;
 
-           th->context.ContextFlags = CONTEXT_DEBUGGER;
+           th->context.ContextFlags = CONTEXT_DEBUGGER_DR;
            GetThreadContext (th->h, &th->context);
          }
        return th;