From patchwork Fri Sep 20 02:44:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 34609 Received: (qmail 118107 invoked by alias); 20 Sep 2019 02:44:45 -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 118092 invoked by uid 89); 20 Sep 2019 02:44:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:INVALID, H*Ad:D*google.com, H*MI:google X-HELO: mail-ua1-f73.google.com Received: from mail-ua1-f73.google.com (HELO mail-ua1-f73.google.com) (209.85.222.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Sep 2019 02:44:43 +0000 Received: by mail-ua1-f73.google.com with SMTP id 13so1156105uag.22 for ; Thu, 19 Sep 2019 19:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Kro8zJ53ZaEApAERQrgKAHJ2J6LlHK8RNJxw7srIuDo=; b=FBZL1v1nbMzVW/PpiV3/CQrTaJ6HCetf3VZEllKbkseZ1tKI4x7BZEj554x7koDQaV Hry6+DwyoeeXRv0j1IVqVaJ7NE/kN0R6pEMnKqnEzPTUKmHwxKhhSm65Dy2FxoLRXHxq 3Kdvg4kG3iI+O73tw0d5IErSwGAGo2be8dMebFMQ6E3gaYVRSm4Y+tcbrNX2OF9I4q5o hXZjVhAvtbBEfR8vcBmrRrS4cw+EZyy6fRQLVm2Kmq7Z6QuQj4tprkJka1p/DAQAWhMU xyXlx5XnSy+g81/wZ4Y2ATSrS61P93CPAFigVN3oKNNa5ZdhC1PpZ5rswcvXwX70b8fW YqVg== Date: Thu, 19 Sep 2019 21:44:38 -0500 Message-Id: <20190920024438.22015-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Move declarations of debug_threads and using_threads to header X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes Instead of declaring debug_threads and using_threads in several .c files, declare them in debug.h. gdb/gdbserver/ChangeLog: 2019-09-20 Christian Biesinger * debug.c (debug_threads): Remove comment in favor of the header. * debug.h (using_threads): Add declaration. (debug_threads): Add comment. * linux-aarch64-low.c: Include debug.h and remove declaration of debug_threads. * nto-low.c: Likewise. * remote-utils.c: Likewise. * thread-db.c: Likewise. --- gdb/gdbserver/debug.c | 3 +-- gdb/gdbserver/debug.h | 6 ++++++ gdb/gdbserver/linux-aarch64-low.c | 5 +---- gdb/gdbserver/nto-low.c | 2 +- gdb/gdbserver/remote-utils.c | 5 +---- gdb/gdbserver/thread-db.c | 3 +-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/gdb/gdbserver/debug.c b/gdb/gdbserver/debug.c index 19f11fc17ce..a764df7688e 100644 --- a/gdb/gdbserver/debug.c +++ b/gdb/gdbserver/debug.c @@ -26,8 +26,7 @@ int remote_debug = 0; /* Output file for debugging. Default to standard error. */ FILE *debug_file = stderr; -/* Enable miscellaneous debugging output. The name is historical - it - was originally used to debug LinuxThreads support. */ +/* See debug.h. */ int debug_threads; /* Include timestamps in debugging output. */ diff --git a/gdb/gdbserver/debug.h b/gdb/gdbserver/debug.h index 07e94eac6ee..c136b9c224c 100644 --- a/gdb/gdbserver/debug.h +++ b/gdb/gdbserver/debug.h @@ -28,7 +28,13 @@ extern int remote_debug; void debug_set_output (const char *debug_file); #endif +extern int using_threads; + +/* Enable miscellaneous debugging output. The name is historical - it + was originally used to debug LinuxThreads support. */ + extern int debug_threads; + extern int debug_timestamp; void debug_flush (void); diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 33095ea752d..ad048171457 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -28,6 +28,7 @@ #include "elf/common.h" #include "ax.h" #include "tracepoint.h" +#include "debug.h" #include #include @@ -153,10 +154,6 @@ aarch64_store_pauthregset (struct regcache *regcache, const void *buf) &pauth_regset[1]); } -/* Enable miscellaneous debugging output. The name is historical - it - was originally used to debug LinuxThreads support. */ -extern int debug_threads; - /* Implementation of linux_target_ops method "get_pc". */ static CORE_ADDR diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c index 011701aa8ce..1987ccc231a 100644 --- a/gdb/gdbserver/nto-low.c +++ b/gdb/gdbserver/nto-low.c @@ -22,6 +22,7 @@ #include "gdbthread.h" #include "nto-low.h" #include "hostio.h" +#include "debug.h" #include #include @@ -32,7 +33,6 @@ #include -extern int using_threads; int using_threads = 1; const struct target_desc *nto_tdesc; diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 665fc66c53d..d7da4b7aed2 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -23,6 +23,7 @@ #include "target.h" #include "gdbthread.h" #include "tdesc.h" +#include "debug.h" #include "dll.h" #include "gdbsupport/rsp-low.h" #include "gdbsupport/netstuff.h" @@ -109,10 +110,6 @@ static int remote_is_stdio = 0; static gdb_fildes_t remote_desc = INVALID_DESCRIPTOR; static gdb_fildes_t listen_desc = INVALID_DESCRIPTOR; -/* FIXME headerize? */ -extern int using_threads; -extern int debug_threads; - #ifdef USE_WIN32API # define read(fd, buf, len) recv (fd, (char *) buf, len, 0) # define write(fd, buf, len) send (fd, (char *) buf, len, 0) diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index b2791b0513a..c6b43a06cca 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -22,8 +22,7 @@ #include "linux-low.h" -extern int debug_threads; - +#include "debug.h" #include "gdb_proc_service.h" #include "nat/gdb_thread_db.h" #include "gdbsupport/gdb_vecs.h"