Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com, Christopher Faylor <cgf@redhat.com>
Subject: Re: [RFA] SSE registers for cygxin target.
Date: Mon, 12 Nov 2001 09:40:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20011126134158.01db4b78@ics.u-strasbg.fr> (raw)
Message-ID: <20011112094000.4uBWsdOJ7NC50ql-qDPgOGW-gRzfnSIm5VV7vejnNKA@z> (raw)
In-Reply-To: <Pine.SUN.3.91.1011126143653.12758G-100000@is>

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


  parent reply	other threads:[~2001-11-26 12:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-26  2:06 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.2.0.58.20011126134158.01db4b78@ics.u-strasbg.fr \
    --to=muller@cerbere.u-strasbg.fr \
    --cc=cgf@redhat.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox