From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20133 invoked by alias); 26 Nov 2001 12:58:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20058 invoked from network); 26 Nov 2001 12:58:35 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sourceware.cygnus.com with SMTP; 26 Nov 2001 12:58:35 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id NAA28740; Mon, 26 Nov 2001 13:58:23 +0100 Message-ID: <4.2.0.58.20011126134158.01db4b78@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Mon, 12 Nov 2001 09:40:00 -0000 To: Eli Zaretskii From: Pierre Muller Subject: Re: [RFA] SSE registers for cygxin target. Cc: gdb-patches@sources.redhat.com, Christopher Faylor In-Reply-To: References: <4.2.0.58.20011126104808.00acab48@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-SW-Source: 2001-11/txt/msg00227.txt.bz2 Message-ID: <20011112094000.4uBWsdOJ7NC50ql-qDPgOGW-gRzfnSIm5VV7vejnNKA@z> 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 provides the PTRACE_GETFPXREGS request. AC_MSG_CHECKING(for PTRACE_GETFPXREGS) AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs, [AC_TRY_COMPILE([#include ], [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