From patchwork Wed Jul 9 10:37:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 1970 Received: (qmail 5745 invoked by alias); 9 Jul 2014 10:39:38 -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 5653 invoked by uid 89); 9 Jul 2014 10:39:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_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; Wed, 09 Jul 2014 10:39:35 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s69AcDdi008716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Jul 2014 06:38:13 -0400 Received: from blade.nx (ovpn-116-101.ams2.redhat.com [10.36.116.101]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s69AcC0B015387 for ; Wed, 9 Jul 2014 06:38:12 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 1799A2640CE for ; Wed, 9 Jul 2014 11:38:11 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 09/15] Mostly remove GDBSERVER from linux-waitpid.c Date: Wed, 9 Jul 2014 11:37:29 +0100 Message-Id: <1404902255-11101-10-git-send-email-gbenson@redhat.com> In-Reply-To: <1404902255-11101-1-git-send-email-gbenson@redhat.com> References: <1404902255-11101-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This commit mostly removes the use of GDBSERVER from nat/linux-waitpid.c. A use remains for some debugging code that I will remove when the Linux thread_db code is refactored. gdb/ 2014-07-09 Gary Benson * configure.ac [AC_CHECK_HEADERS] : New check. * configure: Regenerate. * config.in: Likewise. * nat/linux-waitpid.c: Don't include server.h or defs.h. (linux_debug) [debug_threads]: New declaration. --- gdb/ChangeLog | 8 ++++++++ gdb/config.in | 3 +++ gdb/configure | 2 +- gdb/configure.ac | 2 +- gdb/nat/linux-waitpid.c | 13 ++++++++----- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/gdb/config.in b/gdb/config.in index 8585b49..10b9887 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -129,6 +129,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ELF_HP_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + /* Define to 1 if your system has the etext variable. */ #undef HAVE_ETEXT diff --git a/gdb/configure b/gdb/configure index a4c0a8c..45f3f5f 100755 --- a/gdb/configure +++ b/gdb/configure @@ -9307,7 +9307,7 @@ for ac_header in nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \ termios.h termio.h \ sgtty.h elf_hp.h \ - dlfcn.h + dlfcn.h errno.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/gdb/configure.ac b/gdb/configure.ac index a2ac15f..5f2ace4 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1254,7 +1254,7 @@ AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \ termios.h termio.h \ sgtty.h elf_hp.h \ - dlfcn.h]) + dlfcn.h errno.h]) AC_CHECK_HEADERS(sys/proc.h, [], [], [#if HAVE_SYS_PARAM_H # include diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c index 5159f03..b97ae58 100644 --- a/gdb/nat/linux-waitpid.c +++ b/gdb/nat/linux-waitpid.c @@ -17,11 +17,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#include "signal.h" +#include "config.h" + +#include +#include +#ifdef HAVE_ERRNO_H +#include #endif #include "linux-nat.h" @@ -37,6 +38,8 @@ static inline void linux_debug (const char *format, ...) { #ifdef GDBSERVER + extern int debug_threads; + if (debug_threads) { va_list args;