This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: compile fixes for gdbserver


Pointed out to me by Michal, and committed as obvious.  I think x86-64 may
build and work now...

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-03-04  Daniel Jacobowitz  <drow@mvista.com>

	* gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long.
	(num_regs, regmap): Move inside HAVE_LINUX_USRREGS.
	(register_addr, REGISTER_RAW_SIZE): Likewise.
	(usr_store_inferior_registers): Use PTRACE_XFER_TYPE.
	* gdbserver/linux-x86-64-low.c: Remove extra #endif.

Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.9
diff -u -p -r1.9 linux-low.c
--- linux-low.c	2002/02/27 07:07:39	1.9
+++ linux-low.c	2002/03/04 16:26:34
@@ -36,15 +36,18 @@
 #include <unistd.h>
 
 #define PTRACE_ARG3_TYPE long
-#define PTRACE_XFER_TYPE int
+#define PTRACE_XFER_TYPE long
 
 #ifdef HAVE_LINUX_REGSETS
 static int use_regsets_p = 1;
 #endif
 
 extern int errno;
+
+#ifdef HAVE_LINUX_USRREGS
 extern int num_regs;
 extern int regmap[];
+#endif
 
 /* Start an inferior process and returns its pid.
    ALLARGS is a vector of program-name and args. */
@@ -154,6 +157,9 @@ myresume (int step, int signal)
     perror_with_name ("ptrace");
 }
 
+
+#ifdef HAVE_LINUX_USRREGS
+
 #define REGISTER_RAW_SIZE(regno) register_size((regno))
 
 int
@@ -171,10 +177,6 @@ register_addr (int regnum)
   return addr;
 }
 
-
-
-#ifdef HAVE_LINUX_USRREGS
-
 /* Fetch one register.  */
 static void
 fetch_register (int regno)
@@ -242,7 +244,7 @@ usr_store_inferior_registers (int regno)
       if (regaddr == -1)
 	return;
       errno = 0;
-      for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
+      for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
 	{
 	  errno = 0;
 	  ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
Index: linux-x86-64-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-x86-64-low.c,v
retrieving revision 1.1
diff -u -p -r1.1 linux-x86-64-low.c
--- linux-x86-64-low.c	2002/02/27 07:07:39	1.1
+++ linux-x86-64-low.c	2002/03/04 16:26:34
@@ -74,6 +74,3 @@ struct regset_info target_regsets[] = {
     x86_64_fill_fpregset, x86_64_store_fpregset },
   { 0, 0, -1, NULL, NULL }
 };
-
-#endif /* HAVE_LINUX_REGSETS */
-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]