From: gdbadmin Date: Wed, 1 Sep 2010 17:29:32 +0000 (+0000) Subject: [gdbserver] Move malloc.h include to server.h. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=a778ab81e80a778f4d9b0cf754aa6dc956bdcfd2;p=deliverable%2Fbinutils-gdb.git [gdbserver] Move malloc.h include to server.h. This patch moves all includes of malloc.h, which were introduced purely to get access to alloca's declaration, to server.h, next to the include of alloca.h. There is one exception: gdbreplay.c, which does not include server.h. In this case, the include of alloca.h was simply moved up a bit, next to the include of malloc.h. gdb/gdbserver/ChangeLog: * gdbreplay.c: Move include of alloca.h up, next to include of malloc.h. * server.h: Add include of malloc.h. * mem-break.c: Remove include of malloc.h. * server.c, tracepoint.c, utils.c, win32-low.c: Likewise. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 6f0adc9c45..71e878d076 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,11 @@ +2010-09-01 Joel Brobecker + + * gdbreplay.c: Move include of alloca.h up, next to include of + malloc.h. + * server.h: Add include of malloc.h. + * mem-break.c: Remove include of malloc.h. + * server.c, tracepoint.c, utils.c, win32-low.c: Likewise. + 2010-09-01 Joel Brobecker * Makefile.in (memmem.o): Build with -Wno-error. diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index 4996ffaa56..1f651113a3 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -54,15 +54,15 @@ #if HAVE_NETINET_TCP_H #include #endif +#if HAVE_ALLOCA_H +#include +#endif #if HAVE_MALLOC_H #include #endif #if USE_WIN32API #include #endif -#if HAVE_ALLOCA_H -#include -#endif #ifndef HAVE_SOCKLEN_T typedef int socklen_t; diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c index 687414b8dd..1b084154bb 100644 --- a/gdb/gdbserver/mem-break.c +++ b/gdb/gdbserver/mem-break.c @@ -20,9 +20,6 @@ along with this program. If not, see . */ #include "server.h" -#if HAVE_MALLOC_H -#include -#endif const unsigned char *breakpoint_data; int breakpoint_len; diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index c406abe329..528b65855b 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -28,9 +28,6 @@ #if HAVE_SYS_WAIT_H #include #endif -#if HAVE_MALLOC_H -#include -#endif ptid_t cont_thread; ptid_t general_thread; diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 286c80a52b..d5f32e8cd0 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -41,6 +41,11 @@ #ifdef HAVE_ALLOCA_H #include #endif +/* On some systems such as MinGW, alloca is declared in malloc.h + (there is no alloca.h). */ +#if HAVE_MALLOC_H +#include +#endif #if !HAVE_DECL_STRERROR #ifndef strerror diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index f068ce4196..138d9203a0 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -22,9 +22,6 @@ #include #include #include -#if HAVE_MALLOC_H -#include -#endif #if HAVE_STDINT_H #include #endif diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c index 7de086c77c..aee7e962a8 100644 --- a/gdb/gdbserver/utils.c +++ b/gdb/gdbserver/utils.c @@ -24,9 +24,6 @@ #if HAVE_ERRNO_H #include #endif -#if HAVE_MALLOC_H -#include -#endif #ifdef IN_PROCESS_AGENT # define PREFIX "ipa: " diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index dd26d730b2..5aea8b9417 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #ifndef USE_WIN32API