* [RFA] SSE registers for cygxin target.
@ 2001-11-26 2:06 Pierre Muller
2001-11-11 11:03 ` Pierre Muller
` (2 more replies)
0 siblings, 3 replies; 22+ messages in thread
From: Pierre Muller @ 2001-11-26 2:06 UTC (permalink / raw)
To: gdb-patches; +Cc: Christopher Faylor
The patch below adds SSE registers for cygwin target.
The only missing code is an addendum to configure.in
in order to check if CONTEXT_EXTENDED_REGISTERS
is known in winnt.h header file.
I asked about this in
http://sources.redhat.com/ml/gdb/2001-11/msg00219.html
but got no answers...
But I never wrote any of these rules, and I even don't know how to regenerate
configure from configure.in file ...
For now, to test the patch, you will need to do
a 'make clean' followed by a 'make "CFLAGS=-dHAVE_CONTEXT_EXTENDED_REGISTERS -gstabs+ -O1"'
for instance.
PS: I disabled flowed mode from my Eudora settings and hope that this will
fix the problems existing in the latest patches I sent. Please ask me to send it again attached if
this patch does not aply cleanly.
PS2: Once this patch is in, I will send the next, i.e.
the support of debug registers... DJ Delorie's idea was
correct, this works like a charm (at least for me
on a Win2000 box).
ChangeLog entry:
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.
Index: config/i386/tm-cygwin.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v
retrieving revision 1.10
diff -u -r1.10 tm-cygwin.h
--- tm-cygwin.h 2001/11/01 16:17:08 1.10
+++ tm-cygwin.h 2001/11/26 09:47:09
@@ -19,8 +19,12 @@
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: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.38
diff -u -r1.38 win32-nat.c
--- win32-nat.c 2001/11/24 19:00:03 1.38
+++ win32-nat.c 2001/11/26 09:47:09
@@ -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 @@
#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 @@
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 @@
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;
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
^ permalink raw reply [flat|nested] 22+ messages in thread* [RFA] SSE registers for cygxin target. 2001-11-26 2:06 [RFA] SSE registers for cygxin target Pierre Muller @ 2001-11-11 11:03 ` Pierre Muller 2001-11-12 8:54 ` Eli Zaretskii 2001-11-26 2:10 ` Pierre Muller 2 siblings, 0 replies; 22+ messages in thread From: Pierre Muller @ 2001-11-11 11:03 UTC (permalink / raw) To: gdb-patches; +Cc: Christopher Faylor The patch below adds SSE registers for cygwin target. The only missing code is an addendum to configure.in in order to check if CONTEXT_EXTENDED_REGISTERS is known in winnt.h header file. I asked about this in http://sources.redhat.com/ml/gdb/2001-11/msg00219.html but got no answers... But I never wrote any of these rules, and I even don't know how to regenerate configure from configure.in file ... For now, to test the patch, you will need to do a 'make clean' followed by a 'make "CFLAGS=-dHAVE_CONTEXT_EXTENDED_REGISTERS -gstabs+ -O1"' for instance. PS: I disabled flowed mode from my Eudora settings and hope that this will fix the problems existing in the latest patches I sent. Please ask me to send it again attached if this patch does not aply cleanly. PS2: Once this patch is in, I will send the next, i.e. the support of debug registers... DJ Delorie's idea was correct, this works like a charm (at least for me on a Win2000 box). ChangeLog entry: 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. Index: config/i386/tm-cygwin.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v retrieving revision 1.10 diff -u -r1.10 tm-cygwin.h --- tm-cygwin.h 2001/11/01 16:17:08 1.10 +++ tm-cygwin.h 2001/11/26 09:47:09 @@ -19,8 +19,12 @@ 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: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.38 diff -u -r1.38 win32-nat.c --- win32-nat.c 2001/11/24 19:00:03 1.38 +++ win32-nat.c 2001/11/26 09:47:09 @@ -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 @@ #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 @@ 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 @@ 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; Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 2:06 [RFA] SSE registers for cygxin target Pierre Muller 2001-11-11 11:03 ` Pierre Muller @ 2001-11-12 8:54 ` Eli Zaretskii 2001-11-13 7:48 ` Andrew Cagney 2001-11-26 4:58 ` Pierre Muller 2001-11-26 2:10 ` Pierre Muller 2 siblings, 2 replies; 22+ messages in thread From: Eli Zaretskii @ 2001-11-12 8:54 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches, Christopher Faylor On Mon, 26 Nov 2001, Pierre Muller wrote: > -#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 Is it wise to have SSE registers supported based on the compile-time test? What if the machine on which GDB runs doesn't have SSE? Don't you need a run-time test as well? ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-12 8:54 ` Eli Zaretskii @ 2001-11-13 7:48 ` Andrew Cagney 2001-11-26 12:43 ` Andrew Cagney 2001-11-26 14:23 ` Christopher Faylor 2001-11-26 4:58 ` Pierre Muller 1 sibling, 2 replies; 22+ messages in thread From: Andrew Cagney @ 2001-11-13 7:48 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Pierre Muller, gdb-patches, Christopher Faylor > On Mon, 26 Nov 2001, Pierre Muller wrote: > > >> -#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 > > > Is it wise to have SSE registers supported based on the compile-time > test? What if the machine on which GDB runs doesn't have SSE? Don't you > need a run-time test as well? In theory? Yes, definitly. In reality? GDB has been avoiding the problem and instead has been hardwiring the configurations. Sigh. (This also looks like the PPC and SPARC problem - regcache_collect() is flushing it out ....) The theory goes something like this: o regcache is made large enough to hold all the registers (SSE in this case) o each target (remote.c, *-nat.c) all supply and/sor collect the registers they have into the regcache o on the other side, core-gdbarch register read/write are (dynamically) configured to display the registers, within the register cache Things to note: o the core and the target can disagree on which registers are available but _not_ on the layout of the regcache. o GDB is going to need to make a pretty good educated guess as to what should be displayed when it starts - there may be no target to tell the truth. This is why I've been hacking remote.c - more changes to follow. Andrew ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-13 7:48 ` Andrew Cagney @ 2001-11-26 12:43 ` Andrew Cagney 2001-11-26 14:23 ` Christopher Faylor 1 sibling, 0 replies; 22+ messages in thread From: Andrew Cagney @ 2001-11-26 12:43 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Pierre Muller, gdb-patches, Christopher Faylor > On Mon, 26 Nov 2001, Pierre Muller wrote: > > >> -#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 > > > Is it wise to have SSE registers supported based on the compile-time > test? What if the machine on which GDB runs doesn't have SSE? Don't you > need a run-time test as well? In theory? Yes, definitly. In reality? GDB has been avoiding the problem and instead has been hardwiring the configurations. Sigh. (This also looks like the PPC and SPARC problem - regcache_collect() is flushing it out ....) The theory goes something like this: o regcache is made large enough to hold all the registers (SSE in this case) o each target (remote.c, *-nat.c) all supply and/sor collect the registers they have into the regcache o on the other side, core-gdbarch register read/write are (dynamically) configured to display the registers, within the register cache Things to note: o the core and the target can disagree on which registers are available but _not_ on the layout of the regcache. o GDB is going to need to make a pretty good educated guess as to what should be displayed when it starts - there may be no target to tell the truth. This is why I've been hacking remote.c - more changes to follow. Andrew ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-13 7:48 ` Andrew Cagney 2001-11-26 12:43 ` Andrew Cagney @ 2001-11-26 14:23 ` Christopher Faylor 2001-11-13 8:51 ` Christopher Faylor 2001-11-13 19:54 ` Andrew Cagney 1 sibling, 2 replies; 22+ messages in thread From: Christopher Faylor @ 2001-11-26 14:23 UTC (permalink / raw) To: gdb-patches On Mon, Nov 26, 2001 at 03:43:18PM -0500, Andrew Cagney wrote: >>On Mon, 26 Nov 2001, Pierre Muller wrote: >> >> >>>-#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 >> >> >>Is it wise to have SSE registers supported based on the compile-time >>test? What if the machine on which GDB runs doesn't have SSE? Don't you >>need a run-time test as well? > >In theory? Yes, definitly. In reality? GDB has been avoiding the >problem and instead has been hardwiring the configurations. Sigh. > >(This also looks like the PPC and SPARC problem - regcache_collect() is >flushing it out ....) > >The theory goes something like this: > > o regcache is made large enough to hold > all the registers (SSE in this case) > > o each target (remote.c, *-nat.c) all supply > and/sor collect the registers they have > into the regcache > > o on the other side, core-gdbarch register read/write > are (dynamically) configured to display > the registers, within the register cache > >Things to note: > > o the core and the target can disagree on > which registers are available but _not_ > on the layout of the regcache. > > o GDB is going to need to make a pretty good > educated guess as to what should be displayed > when it starts - there may be no target > to tell the truth. > >This is why I've been hacking remote.c - more changes to follow. So, should I hold off accepting this patch, then? It seems pretty straight-forward except for this issue. cgf ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 14:23 ` Christopher Faylor @ 2001-11-13 8:51 ` Christopher Faylor 2001-11-13 19:54 ` Andrew Cagney 1 sibling, 0 replies; 22+ messages in thread From: Christopher Faylor @ 2001-11-13 8:51 UTC (permalink / raw) To: gdb-patches On Mon, Nov 26, 2001 at 03:43:18PM -0500, Andrew Cagney wrote: >>On Mon, 26 Nov 2001, Pierre Muller wrote: >> >> >>>-#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 >> >> >>Is it wise to have SSE registers supported based on the compile-time >>test? What if the machine on which GDB runs doesn't have SSE? Don't you >>need a run-time test as well? > >In theory? Yes, definitly. In reality? GDB has been avoiding the >problem and instead has been hardwiring the configurations. Sigh. > >(This also looks like the PPC and SPARC problem - regcache_collect() is >flushing it out ....) > >The theory goes something like this: > > o regcache is made large enough to hold > all the registers (SSE in this case) > > o each target (remote.c, *-nat.c) all supply > and/sor collect the registers they have > into the regcache > > o on the other side, core-gdbarch register read/write > are (dynamically) configured to display > the registers, within the register cache > >Things to note: > > o the core and the target can disagree on > which registers are available but _not_ > on the layout of the regcache. > > o GDB is going to need to make a pretty good > educated guess as to what should be displayed > when it starts - there may be no target > to tell the truth. > >This is why I've been hacking remote.c - more changes to follow. So, should I hold off accepting this patch, then? It seems pretty straight-forward except for this issue. cgf ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 14:23 ` Christopher Faylor 2001-11-13 8:51 ` Christopher Faylor @ 2001-11-13 19:54 ` Andrew Cagney 2001-11-13 22:27 ` Christopher Faylor 2001-11-26 20:47 ` Andrew Cagney 1 sibling, 2 replies; 22+ messages in thread From: Andrew Cagney @ 2001-11-13 19:54 UTC (permalink / raw) To: Christopher Faylor; +Cc: gdb-patches > On Mon, Nov 26, 2001 at 03:43:18PM -0500, Andrew Cagney wrote: > >>>On Mon, 26 Nov 2001, Pierre Muller wrote: >>> >>> > >>>>-#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 > So, should I hold off accepting this patch, then? It seems pretty > straight-forward except for this issue. The patch follows established conventions so no point in holding back on it. enjoy, Andrew ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-13 19:54 ` Andrew Cagney @ 2001-11-13 22:27 ` Christopher Faylor 2001-11-26 21:17 ` Christopher Faylor 2001-11-26 20:47 ` Andrew Cagney 1 sibling, 1 reply; 22+ messages in thread From: Christopher Faylor @ 2001-11-13 22:27 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches On Mon, Nov 26, 2001 at 11:46:58PM -0500, Andrew Cagney wrote: >>On Mon, Nov 26, 2001 at 03:43:18PM -0500, Andrew Cagney wrote: >>So, should I hold off accepting this patch, then? It seems pretty >>straight-forward except for this issue. straightforward > >The patch follows established conventions so no point in holding back on it. Ok. I've applied this patch. Thanks, Pierre. cgf ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-13 22:27 ` Christopher Faylor @ 2001-11-26 21:17 ` Christopher Faylor 0 siblings, 0 replies; 22+ messages in thread From: Christopher Faylor @ 2001-11-26 21:17 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches On Mon, Nov 26, 2001 at 11:46:58PM -0500, Andrew Cagney wrote: >>On Mon, Nov 26, 2001 at 03:43:18PM -0500, Andrew Cagney wrote: >>So, should I hold off accepting this patch, then? It seems pretty >>straight-forward except for this issue. straightforward > >The patch follows established conventions so no point in holding back on it. Ok. I've applied this patch. Thanks, Pierre. cgf ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-13 19:54 ` Andrew Cagney 2001-11-13 22:27 ` Christopher Faylor @ 2001-11-26 20:47 ` Andrew Cagney 1 sibling, 0 replies; 22+ messages in thread From: Andrew Cagney @ 2001-11-26 20:47 UTC (permalink / raw) To: Christopher Faylor; +Cc: gdb-patches > On Mon, Nov 26, 2001 at 03:43:18PM -0500, Andrew Cagney wrote: > >>>On Mon, 26 Nov 2001, Pierre Muller wrote: >>> >>> > >>>>-#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 > So, should I hold off accepting this patch, then? It seems pretty > straight-forward except for this issue. The patch follows established conventions so no point in holding back on it. enjoy, Andrew ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-12 8:54 ` Eli Zaretskii 2001-11-13 7:48 ` Andrew Cagney @ 2001-11-26 4:58 ` Pierre Muller 2001-11-12 9:40 ` Pierre Muller 1 sibling, 1 reply; 22+ messages in thread From: Pierre Muller @ 2001-11-26 4:58 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches, Christopher Faylor [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 2560 bytes --] At 13:39 26/11/2001 , Eli Zaretskii a écrit: >On Mon, 26 Nov 2001, Pierre Muller wrote: > > > -#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 > >Is it wise to have SSE registers supported based on the compile-time >test? What if the machine on which GDB runs doesn't have SSE? Don't you >need a run-time test as well? If the machine doesn't have these registers, I don't know what the GetThreadContext will return as I only tested this on a mahine that does have a Pentium iV. It is possible to know with API calls if the processor does have these registers or not, but I don't know how to change the macro NUM_REGS to become a variable defined and check at run-time, but how would that be done for cross-compilation of GDB with cygwin targets ? How is this handled for Linux ? From config/i386/tm-linux.h #ifdef HAVE_PTRACE_GETFPXREGS #define HAVE_SSE_REGS #endif Which in turn is also only a compile time check. # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request. AC_MSG_CHECKING(for PTRACE_GETFPXREGS) AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs, [AC_TRY_COMPILE([#include <sys/ptrace.h>], [PTRACE_GETFPXREGS;], [gdb_cv_have_ptrace_getfpxregs=yes], [gdb_cv_have_ptrace_getfpxregs=no])]) AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs) if test $gdb_cv_have_ptrace_getfpxregs = yes; then AC_DEFINE(HAVE_PTRACE_GETFPXREGS) fi So Linux also only does a compile time check... Of course I agree that this patch must be check to see what happens if the running machine has no extended registers (or if the OS does not know about CONTEXT_EXTENDED_REGISTERS). Get/SetThreadContext might fail in such cases, if that is the case, then I know how to fix the problem: Change CONTEXT_DEBUGGER_DR into a variable and remove the CONTEXT_EXTENDED_REGISTERS specific field if the first call to GetThreadContext fails. But if it accepts CONTEXT_EXTENDED_REGISTERS in all cases, then we are stuck (at least for cross debuggers, no ?). Doing a check at compile time might be a wrong way, as then we would be able to get the SSE regs if the gdb executable was compiled on a SSE-less machine. Any hints welcome.... Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 4:58 ` Pierre Muller @ 2001-11-12 9:40 ` Pierre Muller 0 siblings, 0 replies; 22+ messages in thread From: Pierre Muller @ 2001-11-12 9:40 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches, Christopher Faylor At 13:39 26/11/2001 , Eli Zaretskii a écrit: >On Mon, 26 Nov 2001, Pierre Muller wrote: > > > -#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 > >Is it wise to have SSE registers supported based on the compile-time >test? What if the machine on which GDB runs doesn't have SSE? Don't you >need a run-time test as well? If the machine doesn't have these registers, I don't know what the GetThreadContext will return as I only tested this on a mahine that does have a Pentium iV. It is possible to know with API calls if the processor does have these registers or not, but I don't know how to change the macro NUM_REGS to become a variable defined and check at run-time, but how would that be done for cross-compilation of GDB with cygwin targets ? How is this handled for Linux ? From config/i386/tm-linux.h #ifdef HAVE_PTRACE_GETFPXREGS #define HAVE_SSE_REGS #endif Which in turn is also only a compile time check. # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request. AC_MSG_CHECKING(for PTRACE_GETFPXREGS) AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs, [AC_TRY_COMPILE([#include <sys/ptrace.h>], [PTRACE_GETFPXREGS;], [gdb_cv_have_ptrace_getfpxregs=yes], [gdb_cv_have_ptrace_getfpxregs=no])]) AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs) if test $gdb_cv_have_ptrace_getfpxregs = yes; then AC_DEFINE(HAVE_PTRACE_GETFPXREGS) fi So Linux also only does a compile time check... Of course I agree that this patch must be check to see what happens if the running machine has no extended registers (or if the OS does not know about CONTEXT_EXTENDED_REGISTERS). Get/SetThreadContext might fail in such cases, if that is the case, then I know how to fix the problem: Change CONTEXT_DEBUGGER_DR into a variable and remove the CONTEXT_EXTENDED_REGISTERS specific field if the first call to GetThreadContext fails. But if it accepts CONTEXT_EXTENDED_REGISTERS in all cases, then we are stuck (at least for cross debuggers, no ?). Doing a check at compile time might be a wrong way, as then we would be able to get the SSE regs if the gdb executable was compiled on a SSE-less machine. Any hints welcome.... Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 2:06 [RFA] SSE registers for cygxin target Pierre Muller 2001-11-11 11:03 ` Pierre Muller 2001-11-12 8:54 ` Eli Zaretskii @ 2001-11-26 2:10 ` Pierre Muller 2001-11-11 11:08 ` Pierre Muller ` (2 more replies) 2 siblings, 3 replies; 22+ messages in thread From: Pierre Muller @ 2001-11-26 2:10 UTC (permalink / raw) To: gdb-patches; +Cc: Christopher Faylor Apparently, my Eudora change is not enough to get the patch to be correct, so I add it attached. > The patch below adds SSE registers for cygwin target. > >The only missing code is an addendum to configure.in >in order to check if CONTEXT_EXTENDED_REGISTERS >is known in winnt.h header file. >I asked about this in > http://sources.redhat.com/ml/gdb/2001-11/msg00219.html >but got no answers... > > But I never wrote any of these rules, and I even don't know how to regenerate >configure from configure.in file ... > > For now, to test the patch, you will need to do >a 'make clean' followed by a 'make "CFLAGS=-dHAVE_CONTEXT_EXTENDED_REGISTERS -gstabs+ -O1"' >for instance. > >PS: I disabled flowed mode from my Eudora settings and hope that this will >fix the problems existing in the latest patches I sent. Please ask me to send it again attached if >this patch does not aply cleanly. > >PS2: Once this patch is in, I will send the next, i.e. >the support of debug registers... DJ Delorie's idea was >correct, this works like a charm (at least for me >on a Win2000 box). > > >ChangeLog entry: >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. > > >Index: config/i386/tm-cygwin.h >=================================================================== >RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v >retrieving revision 1.10 >diff -u -r1.10 tm-cygwin.h >--- tm-cygwin.h 2001/11/01 16:17:08 1.10 >+++ tm-cygwin.h 2001/11/26 09:47:09 >@@ -19,8 +19,12 @@ > 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: win32-nat.c >=================================================================== >RCS file: /cvs/src/src/gdb/win32-nat.c,v >retrieving revision 1.38 >diff -u -r1.38 win32-nat.c >--- win32-nat.c 2001/11/24 19:00:03 1.38 >+++ win32-nat.c 2001/11/26 09:47:09 >@@ -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 @@ > #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 @@ > 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 @@ > 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; > > > >Pierre Muller >Institut Charles Sadron >6,rue Boussingault >F 67083 STRASBOURG CEDEX (France) > mailto:muller@ics.u-strasbg.fr >Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 From vinschen@redhat.com Mon Nov 26 03:36:00 2001 From: Corinna Vinschen <vinschen@redhat.com> To: Pierre Muller <muller@cerbere.u-strasbg.fr> Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] SSE registers for cygxin target. Date: Mon, 26 Nov 2001 03:36:00 -0000 Message-id: <20011126123525.R14975@cygbert.vinschen.de> References: <4.2.0.58.20011126104808.00acab48@ics.u-strasbg.fr> <4.2.0.58.20011126110847.01cb6c20@ics.u-strasbg.fr> X-SW-Source: 2001-11/msg00439.html Content-length: 290 On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: > Apparently, my Eudora change is not enough to get the patch to be correct, > so I add it attached. The attachment is corrupted as well, unfortunately. Corinna -- Corinna Vinschen Red Hat, Inc. mailto:vinschen@redhat.com ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 2:10 ` Pierre Muller @ 2001-11-11 11:08 ` Pierre Muller 2001-11-11 12:11 ` Corinna Vinschen 2001-11-12 11:29 ` Christopher Faylor 2 siblings, 0 replies; 22+ messages in thread From: Pierre Muller @ 2001-11-11 11:08 UTC (permalink / raw) To: gdb-patches; +Cc: Christopher Faylor [-- Attachment #1: Type: text/plain, Size: 4481 bytes --] Apparently, my Eudora change is not enough to get the patch to be correct, so I add it attached. > The patch below adds SSE registers for cygwin target. > >The only missing code is an addendum to configure.in >in order to check if CONTEXT_EXTENDED_REGISTERS >is known in winnt.h header file. >I asked about this in >http://sources.redhat.com/ml/gdb/2001-11/msg00219.html >but got no answers... > > But I never wrote any of these rules, and I even don't know how to regenerate >configure from configure.in file ... > > For now, to test the patch, you will need to do >a 'make clean' followed by a 'make "CFLAGS=-dHAVE_CONTEXT_EXTENDED_REGISTERS -gstabs+ -O1"' >for instance. > >PS: I disabled flowed mode from my Eudora settings and hope that this will >fix the problems existing in the latest patches I sent. Please ask me to send it again attached if >this patch does not aply cleanly. > >PS2: Once this patch is in, I will send the next, i.e. >the support of debug registers... DJ Delorie's idea was >correct, this works like a charm (at least for me >on a Win2000 box). > > >ChangeLog entry: >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. > > >Index: config/i386/tm-cygwin.h >=================================================================== >RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v >retrieving revision 1.10 >diff -u -r1.10 tm-cygwin.h >--- tm-cygwin.h 2001/11/01 16:17:08 1.10 >+++ tm-cygwin.h 2001/11/26 09:47:09 >@@ -19,8 +19,12 @@ > 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: win32-nat.c >=================================================================== >RCS file: /cvs/src/src/gdb/win32-nat.c,v >retrieving revision 1.38 >diff -u -r1.38 win32-nat.c >--- win32-nat.c 2001/11/24 19:00:03 1.38 >+++ win32-nat.c 2001/11/26 09:47:09 >@@ -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 @@ > #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 @@ > 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 @@ > 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; > > > >Pierre Muller >Institut Charles Sadron >6,rue Boussingault >F 67083 STRASBOURG CEDEX (France) >mailto:muller@ics.u-strasbg.fr >Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 [-- Attachment #2: win32.diffs --] [-- Type: text/plain, Size: 2543 bytes --] Index: win32-nat.c\0===================================================================\0RCS file: /cvs/src/src/gdb/win32-nat.c,v\0retrieving revision 1.38\0diff -u -r1.38 win32-nat.c\0--- win32-nat.c 2001/11/24 19:00:03 1.38\0+++ win32-nat.c 2001/11/26 09:47:09\0@@ -25,6 +25,7 @@\0 /* We assume we're being built with and will be used for cygwin. */\0 \0 #include "defs.h"\0+#include "tm.h" /* required for SSE registers */\0 #include "frame.h" /* required by inferior.h */\0 #include "inferior.h"\0 #include "target.h"\0@@ -66,6 +67,13 @@\0 #include <sys/procfs.h>\0 #include <psapi.h>\0 \0+#ifdef HAVE_SSE_REGS\0+#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_EXTENDED_REGISTERS \0+#else\0+#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER\0+#endif\0+\0+\0 /* The string sent by cygwin when it processes a signal.\0 FIXME: This should be in a cygwin include file. */\0 #define CYGWIN_SIGNAL_STRING "cygwin: signal"\0@@ -169,6 +177,19 @@\0 context_offset (FloatSave.DataSelector),\0 context_offset (FloatS! ave.DataOffset),\0 context_offset (FloatSave.ErrorSelector)\0+#ifdef HAVE_SSE_REGS\0+ /* XMM0-7 */ ,\0+ context_offset (ExtendedRegisters[0*16]),\0+ context_offset (ExtendedRegisters[1*16]),\0+ context_offset (ExtendedRegisters[2*16]),\0+ context_offset (ExtendedRegisters[3*16]),\0+ context_offset (ExtendedRegisters[4*16]),\0+ context_offset (ExtendedRegisters[5*16]),\0+ context_offset (ExtendedRegisters[6*16]),\0+ context_offset (ExtendedRegisters[7*16]),\0+ /* MXCSR untested */\0+ context_offset (ExtendedRegisters[8*16])\0+#endif\0 };\0 \0 #undef context_offset\0@@ -210,7 +231,7 @@\0 else if (get_context < 0)\0 th->suspend_count = -1;\0 \0- th->context.ContextFlags = CONTEXT_DEBUGGER;\0+ th->context.ContextFlags = CONTEXT_DEBUGGER_DR;\0 GetThreadContext (th->h, &th->context);\0 }\0 return th;\0Index: config/i386/tm-cygwin.h\0===================================================================\0RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v\0retrieving revisi! on 1.10\0diff -u -r1.10 tm-cygwin.h\0--- tm-cygwin.h 2001/11/01 16:17:08 1.10\0+++ tm-cygwin.h 2001/11/26 09:47:09\0@@ -19,8 +19,12 @@\0 Foundation, Inc., 59 Temple Place - Suite 330,\0 Boston, MA 02111-1307, USA. */\0 \0-\0-#undef HAVE_SSE_REGS /* FIXME! win32-nat.c needs to support XMMi registers */\0+/* Use SSE registers if winnt.h contains information about them. */\0+#ifdef HAVE_CONTEXT_EXTENDED_REGISTERS\0+#define HAVE_SSE_REGS\0+#else\0+#undef HAVE_SSE_REGS\0+#endif /* CONTEXT_EXTENDED_REGISTERS */\0 #define HAVE_I387_REGS\0 \0 #include "i386/tm-i386.h"\0 [-- Attachment #3: Type: text/plain, Size: 176 bytes --] Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 2:10 ` Pierre Muller 2001-11-11 11:08 ` Pierre Muller @ 2001-11-11 12:11 ` Corinna Vinschen 2001-11-26 3:44 ` Pierre Muller 2001-11-12 11:29 ` Christopher Faylor 2 siblings, 1 reply; 22+ messages in thread From: Corinna Vinschen @ 2001-11-11 12:11 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: > Apparently, my Eudora change is not enough to get the patch to be correct, > so I add it attached. The attachment is corrupted as well, unfortunately. Corinna -- Corinna Vinschen Red Hat, Inc. mailto:vinschen@redhat.com ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-11 12:11 ` Corinna Vinschen @ 2001-11-26 3:44 ` Pierre Muller 2001-11-11 13:37 ` Pierre Muller 0 siblings, 1 reply; 22+ messages in thread From: Pierre Muller @ 2001-11-26 3:44 UTC (permalink / raw) To: gdb-patches [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 4108 bytes --] At 12:35 26/11/2001 , Corinna Vinschen a écrit: >On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: > > Apparently, my Eudora change is not enough to get the patch to be correct, > > so I add it attached. > >The attachment is corrupted as well, unfortunately. Sorry, its probably because Eudora also misbehaves with text files that only contain LF.... Lets try once again with Dos like CR/LF in source... hope that will help. I also send the diff again in the text itself with yet another Eudora setting. Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.38 diff -u -r1.38 win32-nat.c --- win32-nat.c 2001/11/24 19:00:03 1.38 +++ win32-nat.c 2001/11/26 09:47:09 @@ -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 @@ #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 @@ 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 @@ 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: config/i386/tm-cygwin.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v retrieving revision 1.10 diff -u -r1.10 tm-cygwin.h --- tm-cygwin.h 2001/11/01 16:17:08 1.10 +++ tm-cygwin.h 2001/11/26 09:47:09 @@ -19,8 +19,12 @@ 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" From eliz@is.elta.co.il Mon Nov 26 04:39:00 2001 From: Eli Zaretskii <eliz@is.elta.co.il> To: Pierre Muller <muller@cerbere.u-strasbg.fr> Cc: gdb-patches@sources.redhat.com, Christopher Faylor <cgf@redhat.com> Subject: Re: [RFA] SSE registers for cygxin target. Date: Mon, 26 Nov 2001 04:39:00 -0000 Message-id: <Pine.SUN.3.91.1011126143653.12758G-100000@is> References: <4.2.0.58.20011126104808.00acab48@ics.u-strasbg.fr> X-SW-Source: 2001-11/msg00441.html Content-length: 449 On Mon, 26 Nov 2001, Pierre Muller wrote: > -#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 Is it wise to have SSE registers supported based on the compile-time test? What if the machine on which GDB runs doesn't have SSE? Don't you need a run-time test as well? ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 3:44 ` Pierre Muller @ 2001-11-11 13:37 ` Pierre Muller 0 siblings, 0 replies; 22+ messages in thread From: Pierre Muller @ 2001-11-11 13:37 UTC (permalink / raw) To: gdb-patches [-- Attachment #1: Type: text/plain, Size: 3178 bytes --] At 12:35 26/11/2001 , Corinna Vinschen a écrit: >On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: > > Apparently, my Eudora change is not enough to get the patch to be correct, > > so I add it attached. > >The attachment is corrupted as well, unfortunately. Sorry, its probably because Eudora also misbehaves with text files that only contain LF.... Lets try once again with Dos like CR/LF in source... hope that will help. I also send the diff again in the text itself with yet another Eudora setting. Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.38 diff -u -r1.38 win32-nat.c --- win32-nat.c 2001/11/24 19:00:03 1.38 +++ win32-nat.c 2001/11/26 09:47:09 @@ -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 @@ #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 @@ 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 @@ 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: config/i386/tm-cygwin.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v retrieving revision 1.10 diff -u -r1.10 tm-cygwin.h --- tm-cygwin.h 2001/11/01 16:17:08 1.10 +++ tm-cygwin.h 2001/11/26 09:47:09 @@ -19,8 +19,12 @@ 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" [-- Attachment #2: Type: text/plain, Size: 2539 bytes --] Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.38 diff -u -r1.38 win32-nat.c --- win32-nat.c 2001/11/24 19:00:03 1.38 +++ win32-nat.c 2001/11/26 09:47:09 @@ -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 @@ #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 @@ 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 @@ 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: config/i386/tm-cygwin.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v retrieving revision 1.10 diff -u -r1.10 tm-cygwin.h --- tm-cygwin.h 2001/11/01 16:17:08 1.10 +++ tm-cygwin.h 2001/11/26 09:47:09 @@ -19,8 +19,12 @@ 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" [-- Attachment #3: Type: text/plain, Size: 176 bytes --] Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-26 2:10 ` Pierre Muller 2001-11-11 11:08 ` Pierre Muller 2001-11-11 12:11 ` Corinna Vinschen @ 2001-11-12 11:29 ` Christopher Faylor 2001-11-12 14:28 ` muller 2001-11-26 9:40 ` Christopher Faylor 2 siblings, 2 replies; 22+ messages in thread From: Christopher Faylor @ 2001-11-12 11:29 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: >Apparently, my Eudora change is not enough to get the patch to be correct, >so I add it attached. Actually, that didn't help. Did you look at the attachment? It has a lot of null characters in it where newlines should go. I tried changing the nulls to '\n' but I still get a malformed patch. Sorry. cgf ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-12 11:29 ` Christopher Faylor @ 2001-11-12 14:28 ` muller 2001-11-26 10:43 ` muller 2001-11-26 9:40 ` Christopher Faylor 1 sibling, 1 reply; 22+ messages in thread From: muller @ 2001-11-12 14:28 UTC (permalink / raw) To: gdb-patches At 12:40 26/11/01 -0500, Christopher Faylor wrote: >On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: >>Apparently, my Eudora change is not enough to get the patch to be correct, >>so I add it attached. > >Actually, that didn't help. Did you look at the attachment? It has a lot >of null characters in it where newlines should go. > >I tried changing the nulls to '\n' but I still get a malformed patch. In the last message where I try to send the patch, http://sources.redhat.com/ml/gdb-patches/2001-11/msg00440.html the patch is inlcuded two times into the main text, the second tile seems to be OK, at least to me and Corinna. Christopher, could you confirm that that patch is finally OK? ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-12 14:28 ` muller @ 2001-11-26 10:43 ` muller 0 siblings, 0 replies; 22+ messages in thread From: muller @ 2001-11-26 10:43 UTC (permalink / raw) To: gdb-patches At 12:40 26/11/01 -0500, Christopher Faylor wrote: >On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: >>Apparently, my Eudora change is not enough to get the patch to be correct, >>so I add it attached. > >Actually, that didn't help. Did you look at the attachment? It has a lot >of null characters in it where newlines should go. > >I tried changing the nulls to '\n' but I still get a malformed patch. In the last message where I try to send the patch, http://sources.redhat.com/ml/gdb-patches/2001-11/msg00440.html the patch is inlcuded two times into the main text, the second tile seems to be OK, at least to me and Corinna. Christopher, could you confirm that that patch is finally OK? ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [RFA] SSE registers for cygxin target. 2001-11-12 11:29 ` Christopher Faylor 2001-11-12 14:28 ` muller @ 2001-11-26 9:40 ` Christopher Faylor 1 sibling, 0 replies; 22+ messages in thread From: Christopher Faylor @ 2001-11-26 9:40 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches On Mon, Nov 26, 2001 at 11:10:16AM +0100, Pierre Muller wrote: >Apparently, my Eudora change is not enough to get the patch to be correct, >so I add it attached. Actually, that didn't help. Did you look at the attachment? It has a lot of null characters in it where newlines should go. I tried changing the nulls to '\n' but I still get a malformed patch. Sorry. cgf ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2001-11-27 5:17 UTC | newest] Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2001-11-26 2:06 [RFA] SSE registers for cygxin target Pierre Muller 2001-11-11 11:03 ` Pierre Muller 2001-11-12 8:54 ` Eli Zaretskii 2001-11-13 7:48 ` Andrew Cagney 2001-11-26 12:43 ` Andrew Cagney 2001-11-26 14:23 ` Christopher Faylor 2001-11-13 8:51 ` Christopher Faylor 2001-11-13 19:54 ` Andrew Cagney 2001-11-13 22:27 ` Christopher Faylor 2001-11-26 21:17 ` Christopher Faylor 2001-11-26 20:47 ` Andrew Cagney 2001-11-26 4:58 ` Pierre Muller 2001-11-12 9:40 ` Pierre Muller 2001-11-26 2:10 ` Pierre Muller 2001-11-11 11:08 ` Pierre Muller 2001-11-11 12:11 ` Corinna Vinschen 2001-11-26 3:44 ` Pierre Muller 2001-11-11 13:37 ` Pierre Muller 2001-11-12 11:29 ` Christopher Faylor 2001-11-12 14:28 ` muller 2001-11-26 10:43 ` muller 2001-11-26 9:40 ` Christopher Faylor
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox