aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-09-20 11:40:09 +0900
committerChristian Biesinger <cbiesinger@google.com>2019-09-21 11:00:50 +0900
commitf9d949fb7b85323e3f307884a4a3cef6ba52607b (patch)
treed0faee6739af74b56afda346383fd72665ba58c2 /gdb
parenta7773afff9035cb0e450478bcfe88a5920957e46 (diff)
downloadgdb-f9d949fb7b85323e3f307884a4a3cef6ba52607b.zip
gdb-f9d949fb7b85323e3f307884a4a3cef6ba52607b.tar.gz
gdb-f9d949fb7b85323e3f307884a4a3cef6ba52607b.tar.bz2
Move declarations of debug_threads and using_threads to header
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 <cbiesinger@google.com> * 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog11
-rw-r--r--gdb/gdbserver/debug.c3
-rw-r--r--gdb/gdbserver/debug.h6
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c5
-rw-r--r--gdb/gdbserver/nto-low.c2
-rw-r--r--gdb/gdbserver/remote-utils.c5
-rw-r--r--gdb/gdbserver/thread-db.c3
7 files changed, 22 insertions, 13 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5c76167..c0c6f51 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,14 @@
+2019-09-20 Christian Biesinger <cbiesinger@google.com>
+
+ * 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.
+
2019-09-20 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv (ipa_ppc_linux_regobj): Remove powerpc-cell32l-ipa.o
diff --git a/gdb/gdbserver/debug.c b/gdb/gdbserver/debug.c
index 19f11fc..a764df7 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 07e94ea..c136b9c 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 33095ea..ad04817 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 <signal.h>
#include <sys/user.h>
@@ -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 3c11306..d77fda5 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 <limits.h>
#include <fcntl.h>
@@ -32,7 +33,6 @@
#include <sys/neutrino.h>
-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 665fc66..d7da4b7 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 b2791b0..c6b43a0 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"