From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30330 invoked by alias); 2 Apr 2002 19:55:46 -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 30303 invoked from network); 2 Apr 2002 19:55:43 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 2 Apr 2002 19:55:43 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16sUNe-00025D-00; Tue, 02 Apr 2002 14:55:46 -0500 Date: Tue, 02 Apr 2002 11:55:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Cc: Michael Snyder Subject: [RFA] Save SSE registers to generated core files, without breaking other architectures Message-ID: <20020402145546.A7582@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com, Michael Snyder Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i X-SW-Source: 2002-04/txt/msg00030.txt.bz2 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? -- 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