This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [gdbserver] compiling latest server.c (rev. 1.76) with MinGW for running on win32


Hi Rolf,

Sorry for dropping out on you.

I checked that gdbserver now builds OK with the attached patch
on mingw32 and linux.

Daniel, OK to check in?

-- 
Pedro Alves
2008-07-31  Rolf Jansen  <rj@surtec.com>
	    Pedro Alves  <pedro@codesourcery.com>

	* configure.ac: Check for memmem declaration.
	* server.c [HAVE_MALLOC_H]: Include malloc.h.
	(disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
	(disable_packet_qfThreadInfo): Unconditionally compile.
	* server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
	* configure, config.in: Regenerate.

---
 gdb/gdbserver/configure.ac |    2 +-
 gdb/gdbserver/server.c     |   19 +++++++++++--------
 gdb/gdbserver/server.h     |    4 ++++
 3 files changed, 16 insertions(+), 9 deletions(-)

Index: src/gdb/gdbserver/configure.ac
===================================================================
--- src.orig/gdb/gdbserver/configure.ac	2008-06-06 12:25:11.000000000 +0100
+++ src/gdb/gdbserver/configure.ac	2008-07-31 17:10:46.000000000 +0100
@@ -61,7 +61,7 @@ AC_TRY_LINK([
   [AC_MSG_RESULT(no)])
 fi
 
-AC_CHECK_DECLS([strerror, perror])
+AC_CHECK_DECLS([strerror, perror, memmem])
 
 AC_CHECK_TYPES(socklen_t, [], [],
 [#include <sys/types.h>
Index: src/gdb/gdbserver/server.c
===================================================================
--- src.orig/gdb/gdbserver/server.c	2008-07-08 00:05:33.000000000 +0100
+++ src/gdb/gdbserver/server.c	2008-07-31 17:10:46.000000000 +0100
@@ -28,6 +28,9 @@
 #if HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
 
 unsigned long cont_thread;
 unsigned long general_thread;
@@ -67,14 +70,6 @@ int terminal_fd;
 /* TERMINAL_FD's original foreground group.  */
 pid_t old_foreground_pgrp;
 
-/* Set if you want to disable optional thread related packets support
-   in gdbserver, for the sake of testing GDB against stubs that don't
-   support them.  */
-int disable_packet_vCont;
-int disable_packet_Tthread;
-int disable_packet_qC;
-int disable_packet_qfThreadInfo;
-
 /* Hand back terminal ownership to the original foreground group.  */
 
 static void
@@ -84,6 +79,14 @@ restore_old_foreground_pgrp (void)
 }
 #endif
 
+/* Set if you want to disable optional thread related packets support
+   in gdbserver, for the sake of testing GDB against stubs that don't
+   support them.  */
+int disable_packet_vCont;
+int disable_packet_Tthread;
+int disable_packet_qC;
+int disable_packet_qfThreadInfo;
+
 static int
 target_running (void)
 {
Index: src/gdb/gdbserver/server.h
===================================================================
--- src.orig/gdb/gdbserver/server.h	2008-07-02 12:35:07.000000000 +0100
+++ src/gdb/gdbserver/server.h	2008-07-31 17:10:46.000000000 +0100
@@ -50,6 +50,10 @@ extern void perror (const char *);
 #endif
 #endif
 
+#if !HAVE_DECL_MEMMEM
+extern void *memmem (const void *, size_t , const void *, size_t);
+#endif
+
 #ifndef ATTR_NORETURN
 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
 #define ATTR_NORETURN __attribute__ ((noreturn))

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