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,

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


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