From patchwork Thu May 30 21:30:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32952 Received: (qmail 95626 invoked by alias); 30 May 2019 21:30:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 95618 invoked by uid 89); 30 May 2019 21:30:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=extremely X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 May 2019 21:30:52 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 937D61B944E for ; Thu, 30 May 2019 16:30:51 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id WSdPhG5Fx4FKpWSdPhb3c8; Thu, 30 May 2019 16:30:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NL5+ttkG8QbM3NFjcxzLL8E/dqN2aS5JGgd51ylajAg=; b=de7wEsF4CMOdLODD/X/2SEf+yu gHxYNwVyN0G0rlAjx+yP6xhN5ghhLNIWkjRklbqROs4W4ET1a6B8sE+1Fnpzm2U5ux/YFWYLk4A7O 3/v/7PtXgY8y4B+SmvyLHP5hW; Received: from 174-29-48-168.hlrn.qwest.net ([174.29.48.168]:43126 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hWSdP-000zWh-DB; Thu, 30 May 2019 16:30:51 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 1/2] Remove linux-waitpid.c debugging code Date: Thu, 30 May 2019 15:30:45 -0600 Message-Id: <20190530213046.20542-2-tom@tromey.com> In-Reply-To: <20190530213046.20542-1-tom@tromey.com> References: <20190530213046.20542-1-tom@tromey.com> The debugging code in linux-waitpid.c is one of the few remaining spots that depends on the gdb/gdbserver difference. My first thought was that this code is not extremely useful, so this patch removes this code. (However, if it is actually useful to someone, we could make it work by introducing a new abstraction.) gdb/ChangeLog 2019-05-30 Tom Tromey * nat/linux-waitpid.c: Don't include server.h. (linux_debug): Remove. (my_waitpid): Update. --- gdb/ChangeLog | 6 ++++++ gdb/nat/linux-waitpid.c | 34 +--------------------------------- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c index a7d11ab8d32..298032dff9a 100644 --- a/gdb/nat/linux-waitpid.c +++ b/gdb/nat/linux-waitpid.c @@ -19,35 +19,10 @@ #include "common/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" -#endif - #include "linux-nat.h" #include "linux-waitpid.h" #include "common/gdb_wait.h" -/* Print debugging output based on the format string FORMAT and - its parameters. */ - -static inline void ATTRIBUTE_PRINTF (1,2) -linux_debug (const char *format, ...) -{ -#ifdef GDBSERVER - if (debug_threads) - { - va_list args; - va_start (args, format); - debug_vprintf (format, args); - va_end (args); - } -#endif -} - /* Convert wait status STATUS to a string. Used for printing debug messages only. */ @@ -79,20 +54,13 @@ status_to_str (int status) int my_waitpid (int pid, int *status, int flags) { - int ret, out_errno; - - linux_debug ("my_waitpid (%d, 0x%x)\n", pid, flags); + int ret; do { ret = waitpid (pid, status, flags); } while (ret == -1 && errno == EINTR); - out_errno = errno; - - linux_debug ("my_waitpid (%d, 0x%x): status(%x), %d\n", - pid, flags, (ret > 0 && status != NULL) ? *status : -1, ret); - errno = out_errno; return ret; }