From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29129 invoked by alias); 1 Sep 2010 17:10:21 -0000 Received: (qmail 28621 invoked by uid 22791); 1 Sep 2010 17:10:18 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Sep 2010 17:10:13 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 74DEA2BAC63; Wed, 1 Sep 2010 13:10:11 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9INlv3nGyAUc; Wed, 1 Sep 2010 13:10:11 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 25DD02BAC5E; Wed, 1 Sep 2010 13:10:11 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id C5DF4F599F; Wed, 1 Sep 2010 19:10:00 +0200 (CEST) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [RFA/gdbserver] Move malloc.h include to server.h. Date: Wed, 01 Sep 2010 17:10:00 -0000 Message-Id: <1283360985-30122-1-git-send-email-brobecker@adacore.com> In-Reply-To: <201009011241.10997.pedro@codesourcery.com> References: <201009011241.10997.pedro@codesourcery.com> 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: 2010-09/txt/msg00025.txt.bz2 As discussed: 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: * gdbserver/gdbreplay.c: Move include of alloca.h up, next to include of malloc.h. * gdbserver/server.h: Add include of malloc.h. * gdbserver/mem-break.c: Remove include of malloc.h. * gdbserver/server.c, gdbserver/tracepoint.c, gdbserver/utils.c, gdbserver/win32-low.c: Likewise. Tested on x86_64-linux. I also verified that gdbserver still builds on MinGW... --- gdb/gdbserver/gdbreplay.c | 6 +++--- gdb/gdbserver/mem-break.c | 3 --- gdb/gdbserver/server.c | 3 --- gdb/gdbserver/server.h | 5 +++++ gdb/gdbserver/tracepoint.c | 3 --- gdb/gdbserver/utils.c | 3 --- gdb/gdbserver/win32-low.c | 1 - 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index 4996ffa..1f65111 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 687414b..1b08415 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 c406abe..528b658 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 286c80a..d5f32e8 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 f068ce4..138d920 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 7de086c..aee7e96 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 dd26d73..5aea8b9 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 -- 1.7.1