This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [gdbserver] compiling latest server.c (rev. 1.76) with MinGW for running on win32
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Dr. Rolf Jansen" <rj at surtec dot com>
- Date: Fri, 18 Jul 2008 20:32:31 +0100
- Subject: Re: [gdbserver] compiling latest server.c (rev. 1.76) with MinGW for running on win32
- References: <CA429CE7-12AD-4308-B44A-23D2F5E416EF@surtec.com>
Hi Rolf,
On Friday 18 July 2008 18:32:32, Dr. Rolf Jansen wrote:
> The latest server.c rev 1.76 does produce warnings when compiled with Â
> the MinGW tools:
>
> server.c: In function 'start_inferior':
> server.c:107: warning: implicit declaration of function 'alloca'
> server.c:107: warning: incompatible implicit declaration of built-in Â
> function 'alloca'
> server.c: In function 'handle_search_memory_1':
> server.c:356: warning: implicit declaration of function 'memmem'
> server.c:356: warning: assignment makes pointer from integer without a Â
> cast
> MinGW defines alloca() in <malloc.h> and memmem() is not built-in. I Â
> think this should eventually be addressed in the configure script, Â
> however, as a quick fix, I added at the top of server.c:
> #if USE_WIN32API
> #include <malloc.h>
This bit be done with...
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
... instead. We're already doing that in utils.c.
> void *memmem (const void *haystack_start, size_t haystack_len, const Â
> void *needle_start, size_t needle_len);
> #endif
Hmmm, shouldn't we be picking up memmem's definition from gnulib's string.h,
since we're using memmem from gnulib?
> In addition, linking of gdbserver.exe fails because of undefined
> references:
>
> remote-utils.o:remote-utils.c:(.text+0x1057): undefined reference to
> `_disable_packet_Tthread'
> In order to resolve the linking errors, the definition of the Â
> respective variables must be moved out of the conditional block Â
> (#ifdef SIGTTOU ... #endif), because they are used also within non-
> conditional code in remote-utils.c and in server.c.
>
Ooops. Yes, it should move out of the #if block. It was just an
oversight. No need to add the SIGTTOU checks around the
--disable-packet handling.
--
Pedro Alves