public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [commit] Cleanup: Remove dead FILL_FPXREGSET code
@ 2010-06-11 12:17 Ulrich Weigand
  2010-06-11 12:47 ` Ulrich Weigand
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Weigand @ 2010-06-11 12:17 UTC (permalink / raw)
  To: gdb-patches

Hello,

while looking at gregset handling for other reasons, I noticed that we
still have a block guarded by #ifdef FILL_FPXREGSET in gregset.h.

This is now dead code as the i386 target was changed to use the new
gdbarch_core_regset_sections mechanism instead; linux-nat.c no longer
uses any of the definitions depending on FILL_FPXREGSET.

This patch cleans this up by removing the block in gregset.h and the
definition of FILL_FPXREGSET in config/i386/nm-linux.h; the latter
now makes the complete file superfluous.

Tested on i386-linux, committed to mainline.

Bye,
Ulrich


ChangeLog:

	* gregset.h (GDB_FPXREGSET_T): Remove.
	(gdb_fpxregset_t): Likewise.
	(supply_fpxregset): Remove prototype.
	(fill_fpxregset): Likewise.
	* i386-linux-nat.c (supply_fpxregset): Remove.
	(fill_fpxregset): Likewise.
	(fetch_fpxregs): Inline supply_fpxregset call.
	(store_fpxregs): Inline fill_fpxregset call.

	* config/i386/linux.mh: Set NAT_FILE to config/nm-linux.h.
	* config/i386/nm-linux.h: Remove file.


Index: gdb/gregset.h
===================================================================
RCS file: /cvs/src/src/gdb/gregset.h,v
retrieving revision 1.14
diff -u -p -r1.14 gregset.h
--- gdb/gregset.h	1 Jan 2010 07:31:33 -0000	1.14
+++ gdb/gregset.h	10 Jun 2010 18:01:59 -0000
@@ -57,20 +57,4 @@ extern void fill_gregset (const struct r
 extern void fill_fpregset (const struct regcache *regcache,
 			   gdb_fpregset_t *fpregs, int regno);
 
-#ifdef FILL_FPXREGSET
-/* GNU/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 (struct regcache *regcache,
-			      const gdb_fpxregset_t *fpxregs);
-extern void fill_fpxregset (const struct regcache *regcache,
-			    gdb_fpxregset_t *fpxregs, int regno);
-#endif
-
 #endif
Index: gdb/i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.99
diff -u -p -r1.99 i386-linux-nat.c
--- gdb/i386-linux-nat.c	22 Apr 2010 20:35:28 -0000	1.99
+++ gdb/i386-linux-nat.c	10 Jun 2010 18:01:59 -0000
@@ -413,27 +413,6 @@ store_xstateregs (const struct regcache 
 
 #ifdef HAVE_PTRACE_GETFPXREGS
 
-/* Fill GDB's register array with the floating-point and SSE register
-   values in *FPXREGSETP.  */
-
-void
-supply_fpxregset (struct regcache *regcache,
-		  const elf_fpxregset_t *fpxregsetp)
-{
-  i387_supply_fxsave (regcache, -1, fpxregsetp);
-}
-
-/* Fill register REGNO (if it is a floating-point or SSE register) in
-   *FPXREGSETP with the value in GDB's register array.  If REGNO is
-   -1, do this for all registers.  */
-
-void
-fill_fpxregset (const struct regcache *regcache,
-		elf_fpxregset_t *fpxregsetp, int regno)
-{
-  i387_collect_fxsave (regcache, regno, fpxregsetp);
-}
-
 /* Fetch all registers covered by the PTRACE_GETFPXREGS request from
    process/thread TID and store their values in GDB's register array.
    Return non-zero if successful, zero otherwise.  */
@@ -457,7 +436,7 @@ fetch_fpxregs (struct regcache *regcache
       perror_with_name (_("Couldn't read floating-point and SSE registers"));
     }
 
-  supply_fpxregset (regcache, (const elf_fpxregset_t *) &fpxregs);
+  i387_supply_fxsave (regcache, -1, (const elf_fpxregset_t *) &fpxregs);
   return 1;
 }
 
@@ -484,7 +463,7 @@ store_fpxregs (const struct regcache *re
       perror_with_name (_("Couldn't read floating-point and SSE registers"));
     }
 
-  fill_fpxregset (regcache, &fpxregs, regno);
+  i387_collect_fxsave (regcache, regno, &fpxregs);
 
   if (ptrace (PTRACE_SETFPXREGS, tid, 0, &fpxregs) == -1)
     perror_with_name (_("Couldn't write floating-point and SSE registers"));
Index: gdb/config/i386/linux.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/linux.mh,v
retrieving revision 1.23
diff -u -p -r1.23 linux.mh
--- gdb/config/i386/linux.mh	28 May 2010 18:50:31 -0000	1.23
+++ gdb/config/i386/linux.mh	10 Jun 2010 18:02:00 -0000
@@ -1,6 +1,6 @@
 # Host: Intel 386 running GNU/Linux.
 
-NAT_FILE= nm-linux.h
+NAT_FILE= config/nm-linux.h
 NATDEPFILES= inf-ptrace.o fork-child.o \
 	i386-nat.o i386-linux-nat.o \
 	proc-service.o linux-thread-db.o \
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [commit] Cleanup: Remove dead FILL_FPXREGSET code
  2010-06-11 12:17 [commit] Cleanup: Remove dead FILL_FPXREGSET code Ulrich Weigand
@ 2010-06-11 12:47 ` Ulrich Weigand
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Weigand @ 2010-06-11 12:47 UTC (permalink / raw)
  To: gdb-patches


> 	* config/i386/nm-linux.h: Remove file.

Now that this file is gone, it no longer needs to be listed in
HFILES_NO_SRCDIR in the Makefile.  Sorry for overlooking this.

Tested on i386-linux, committed to mainline.

Bye,
Ulrich


ChangeLog:
 
	* Makefile.in (HFILES_NO_SRCDIR): Remove config/i386/nm-linux.h

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1124
diff -u -p -r1.1124 Makefile.in
--- gdb/Makefile.in	28 May 2010 18:50:30 -0000	1.1124
+++ gdb/Makefile.in	11 Jun 2010 12:42:30 -0000
@@ -770,7 +770,7 @@ language.h nbsd-tdep.h wrapper.h solib-s
 macroexp.h ui-file.h regcache.h gdb_string.h tracepoint.h i386-tdep.h \
 inf-child.h p-lang.h event-top.h gdbtypes.h scm-tags.h user-regs.h \
 regformats/regdef.h config/alpha/nm-osf3.h  config/i386/nm-i386gnu.h \
-config/i386/nm-fbsd.h config/i386/nm-linux.h \
+config/i386/nm-fbsd.h \
 config/nm-nto.h config/sparc/nm-sol2.h config/nm-linux.h \
 config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \
 annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h	\


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-11 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-11 12:17 [commit] Cleanup: Remove dead FILL_FPXREGSET code Ulrich Weigand
2010-06-11 12:47 ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).