From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25673 invoked by alias); 2 Apr 2002 22:00:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25629 invoked from network); 2 Apr 2002 22:00:17 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 2 Apr 2002 22:00:17 -0000 Received: from redhat.com (notinuse.cygnus.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id OAA19454; Tue, 2 Apr 2002 14:00:14 -0800 (PST) Message-ID: <3CAA274A.C0170CF@redhat.com> Date: Tue, 02 Apr 2002 14:00:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] Save SSE registers to generated core files, without breaking other architectures References: <20020402145546.A7582@nevyn.them.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00042.txt.bz2 Daniel Jacobowitz wrote: > > How does this patch look? The original problem was that we can not rely on > HAVE_PTRACE_FPXREGSET, because the presence of PTRACE_FPXREGSET doesn't > imply that GDB has a fill_fpxregset function available. I updated it to > check for a separate flag. It's not ideal, but until we separate regset > handling into an appropriate vector, it's the best we can do (I think). > > OK? Well, I like it (and thanks for working on it), but Andrew might have something to say about adding a new macro. Andrew? > > -- > Daniel Jacobowitz Carnegie Mellon University > MontaVista Software Debian GNU/Linux Developer > > 2002-04-02 Daniel Jacobowitz > > * config/i386/tm-linux.h: Define FILL_FPXREGSET. > * gregset.h: If FILL_FPXREGSET is defined, provide > gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset. > * linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET > is defined, call fill_fpxregset. > > Index: gregset.h > =================================================================== > RCS file: /cvs/src/src/gdb/gregset.h,v > retrieving revision 1.5 > diff -u -p -r1.5 gregset.h > --- gregset.h 2002/02/24 22:14:33 1.5 > +++ gregset.h 2002/04/02 19:51:15 > @@ -52,5 +52,18 @@ extern void supply_fpregset (gdb_fpregse > extern void fill_gregset (gdb_gregset_t *gregs, int regno); > extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno); > > +#ifdef FILL_FPXREGSET > +/* Linux/i386: Copy register values between GDB's internal register cache > + and the i386 extended floating point registers. */ > + > +#ifndef GDB_FPXREGSET_T > +#define GDB_FPXREGSET_T elf_fpxregset_t > +#endif > + > +typedef GDB_FPXREGSET_T gdb_fpxregset_t; > + > +extern void supply_fpxregset (gdb_fpxregset_t *fpxregs); > +extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno); > +#endif > > #endif > Index: linux-proc.c > =================================================================== > RCS file: /cvs/src/src/gdb/linux-proc.c,v > retrieving revision 1.8 > diff -u -p -r1.8 linux-proc.c > --- linux-proc.c 2002/03/25 19:47:41 1.8 > +++ linux-proc.c 2002/04/02 19:51:15 > @@ -167,6 +167,9 @@ linux_do_thread_registers (bfd *obfd, pt > { > gdb_gregset_t gregs; > gdb_fpregset_t fpregs; > +#ifdef FILL_FPXREGSET > + gdb_fpxregset_t fpxregs; > +#endif > unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid); > > fill_gregset (&gregs, -1); > @@ -183,6 +186,14 @@ linux_do_thread_registers (bfd *obfd, pt > note_size, > &fpregs, > sizeof (fpregs)); > +#ifdef FILL_FPXREGSET > + fill_fpxregset (&fpxregs, -1); > + note_data = (char *) elfcore_write_prxfpreg (obfd, > + note_data, > + note_size, > + &fpxregs, > + sizeof (fpxregs)); > +#endif > return note_data; > } > > Index: config/i386/tm-linux.h > =================================================================== > RCS file: /cvs/src/src/gdb/config/i386/tm-linux.h,v > retrieving revision 1.17 > diff -u -p -r1.17 tm-linux.h > --- tm-linux.h 2002/02/24 22:56:05 1.17 > +++ tm-linux.h 2002/04/02 19:51:46 > @@ -26,6 +26,7 @@ > #define I386_GNULINUX_TARGET > #define HAVE_I387_REGS > #ifdef HAVE_PTRACE_GETFPXREGS > +#define FILL_FPXREGSET > #define HAVE_SSE_REGS > #endif >