From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25592 invoked by alias); 31 Jul 2008 16:19:08 -0000 Received: (qmail 25578 invoked by uid 22791); 31 Jul 2008 16:19:06 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 Jul 2008 16:18:38 +0000 Received: (qmail 5537 invoked from network); 31 Jul 2008 16:18:36 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 31 Jul 2008 16:18:36 -0000 From: Pedro Alves To: Dr. Rolf Jansen Subject: Re: [gdbserver] compiling latest server.c (rev. 1.76) with MinGW for running on win32 Date: Thu, 31 Jul 2008 16:19:00 -0000 User-Agent: KMail/1.9.9 Cc: gdb-patches@sourceware.org References: <200807182032.31901.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_gXekIuDpcA6/mU9" Message-Id: <200807311718.40766.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00584.txt.bz2 --Boundary-00=_gXekIuDpcA6/mU9 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 169 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 --Boundary-00=_gXekIuDpcA6/mU9 Content-Type: text/x-diff; charset="iso-8859-1"; name="memmem.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="memmem.diff" Content-length: 2892 2008-07-31 Rolf Jansen Pedro Alves * 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 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 #endif +#if HAVE_MALLOC_H +#include +#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)) --Boundary-00=_gXekIuDpcA6/mU9--