From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19193 invoked by alias); 12 Sep 2014 10:03:51 -0000 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 Received: (qmail 19184 invoked by uid 89); 12 Sep 2014 10:03:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 12 Sep 2014 10:03:45 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8CA3hue007978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Sep 2014 06:03:43 -0400 Received: from blade.nx (ovpn-116-128.ams2.redhat.com [10.36.116.128]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8CA3gLE003434; Fri, 12 Sep 2014 06:03:42 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id C41A62623EF; Fri, 12 Sep 2014 11:03:41 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Cc: Pedro Alves , Doug Evans Subject: [PATCH v8] Clarify GDBSERVER use in linux-waitpid.c Date: Fri, 12 Sep 2014 10:03:00 -0000 Message-Id: <1410516221-19088-1-git-send-email-gbenson@redhat.com> In-Reply-To: <5410523B.8020305@redhat.com> References: <5410523B.8020305@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00388.txt.bz2 Pedro Alves wrote: > Sorry, but now that I see it, IMO the end up resulting code > doesn't really look better than what we already have. :-/ > We end up with #ifdef GDBSERVER anyway, so might be best to > either leave this be until we come up with a complete solution. Ok, how about this: This commit makes linux-waitpid.c include common-defs.h. GDB's inclusion of defs.h is removed, but gdbserver's inclusion of server.h remains to support some gdbserver-specific debug code that cannot presently be merged. A new FIXME documents this. gdb/ChangeLog: * nat/linux-waitpid.c: Include common-defs.h. [GDBSERVER]: Add FIXME comment. [!GDBSERVER]: Don't include defs.h or signal.h. (linux_debug) [!GDBSERVER]: Remove empty block. --- gdb/ChangeLog | 7 +++++++ gdb/nat/linux-waitpid.c | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c index 53847ac..04cdc3d 100644 --- a/gdb/nat/linux-waitpid.c +++ b/gdb/nat/linux-waitpid.c @@ -17,11 +17,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "common-defs.h" + #ifdef GDBSERVER +/* FIXME: server.h is required for the definition of debug_threads + which is used in the gdbserver-specific debug printing in + linux_debug. This code should be made available to GDB also, + but the lack of a suitable flag to enable it prevents this. */ #include "server.h" -#else -#include "defs.h" -#include "signal.h" #endif #include "linux-nat.h" @@ -42,8 +45,6 @@ linux_debug (const char *format, ...) vfprintf (stderr, format, args); va_end (args); } -#else - /* GDB-specific debugging output. */ #endif } -- 1.7.1