aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-01-22 12:39:08 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-01-22 12:39:08 -0500
commitcda09ec9f9cbebef06345a5fb768f347267b3d73 (patch)
treeb6edea162ae49154dc354e1be8c69a41467d693b
parentbaf2b57f18c8669ef3521888a2dee2a545214bcd (diff)
downloadfsf-binutils-gdb-cda09ec9f9cbebef06345a5fb768f347267b3d73.zip
fsf-binutils-gdb-cda09ec9f9cbebef06345a5fb768f347267b3d73.tar.gz
fsf-binutils-gdb-cda09ec9f9cbebef06345a5fb768f347267b3d73.tar.bz2
gdb: move remote_debug to remote.{h,c}
remote_debug is currently declared in target.h and defined in top.c. Move them to remote.h and remote.c. Include remote.h in remote-sim.c, as it uses remote_debug. gdb/ChangeLog: * target.h (remote_debug): Move to... * remote.h (remote_debug): ... here. * top.c (remote_debug): Move to... * remote.c (remote_debug): ... here. * remote-sim.c: Include remote.h. Change-Id: Iae632d12ff8900b23eee6b2529d6a3cd339a8caa
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/remote-sim.c1
-rw-r--r--gdb/remote.c4
-rw-r--r--gdb/remote.h4
-rw-r--r--gdb/target.h3
-rw-r--r--gdb/top.c4
6 files changed, 17 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0eee5b5..ceb6b10 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
+ * target.h (remote_debug): Move to...
+ * remote.h (remote_debug): ... here.
+ * top.c (remote_debug): Move to...
+ * remote.c (remote_debug): ... here.
+ * remote-sim.c: Include remote.h.
+
+2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
+
* cli/cli-cmds.c (show_remote_debug): Remove.
(show_remote_timeout): Remove.
(_initialize_cli_cmds): Don't register commands.
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b21a4e8..d511305 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -43,6 +43,7 @@
#include "gdbthread.h"
#include "gdbsupport/byte-vector.h"
#include "memory-map.h"
+#include "remote.h"
/* Prototypes */
diff --git a/gdb/remote.c b/gdb/remote.c
index 3793128..79ce6a3 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -87,6 +87,10 @@ Use a remote computer via a serial line, using a gdb-specific protocol.\n\
Specify the serial device it is connected to\n\
(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.).");
+/* See remote.h */
+
+int remote_debug = 0;
+
#define OPAQUETHREADBYTES 8
/* a 64 bit opaque identifier */
diff --git a/gdb/remote.h b/gdb/remote.h
index 51cdbcc..de582a2 100644
--- a/gdb/remote.h
+++ b/gdb/remote.h
@@ -24,6 +24,10 @@
struct target_desc;
struct remote_target;
+/* Debugging level. 0 is off, and non-zero values mean to print some debug
+ information (higher values, more information). */
+extern int remote_debug;
+
/* Read a packet from the remote machine, with error checking, and
store it in *BUF. Resize *BUF using xrealloc if necessary to hold
the result, and update *SIZEOF_BUF. If FOREVER, wait forever
diff --git a/gdb/target.h b/gdb/target.h
index 40bf416..917476d 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -2473,9 +2473,6 @@ extern gdb::optional<gdb::char_vector> target_get_osdata (const char *type);
/* Stuff that should be shared among the various remote targets. */
-/* Debugging level. 0 is off, and non-zero values mean to print some debug
- information (higher values, more information). */
-extern int remote_debug;
/* Timeout limit for response from target. */
extern int remote_timeout;
diff --git a/gdb/top.c b/gdb/top.c
index 4b0defd..15fbd6d 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -198,10 +198,6 @@ bool server_command;
int remote_timeout = 2;
-/* Non-zero tells remote* modules to output debugging info. */
-
-int remote_debug = 0;
-
/* Sbrk location on entry to main. Used for statistics only. */
#ifdef HAVE_USEFUL_SBRK
char *lim_at_start;