From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] gdb: move baud_rate and serial_parity declarations to serial.h
Date: Tue, 12 Jan 2021 00:44:40 -0500 [thread overview]
Message-ID: <20210112054441.1188693-1-simon.marchi@polymtl.ca> (raw)
They are currently in target.h, it would make more sense to have them in
serial.h, since they are defined in serial.c.
gdb/ChangeLog:
* target.h (baud_rate, serial_parity): Move declarations...
* serial.h: ... here.
* main.c: Include serial.h.
* serial.c (baud_rate, serial_parity): Update doc.
Change-Id: Idc983c154c80ccc29b07ce68df3483cefe03fb71
---
gdb/main.c | 1 +
gdb/serial.c | 7 ++-----
gdb/serial.h | 8 ++++++++
gdb/target.h | 6 ------
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdb/main.c b/gdb/main.c
index 9e52c4153656..1e1fbf2f3512 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -54,6 +54,7 @@
#endif
#include "gdbsupport/alt-stack.h"
#include "observable.h"
+#include "serial.h"
/* The selected interpreter. This will be used as a set command
variable, so it should always be malloc'ed - since
diff --git a/gdb/serial.c b/gdb/serial.c
index 4b75178021b3..1854721d7ed6 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -623,10 +623,7 @@ serial_pipe (struct serial *scbs[2])
static struct cmd_list_element *serial_set_cmdlist;
static struct cmd_list_element *serial_show_cmdlist;
-/* Baud rate specified for talking to serial target systems. Default
- is left as -1, so targets can choose their own defaults. */
-/* FIXME: This means that "show serial baud" and gr_files_info can
- print -1 or (unsigned int)-1. This is a Bad User Interface. */
+/* See serial.h. */
int baud_rate = -1;
@@ -638,7 +635,7 @@ serial_baud_show_cmd (struct ui_file *file, int from_tty,
value);
}
-/* Parity for serial port. */
+/* See serial.h. */
int serial_parity = GDBPARITY_NONE;
diff --git a/gdb/serial.h b/gdb/serial.h
index d9f5d4ba5ef9..9a800491afff 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -36,6 +36,14 @@ typedef void *serial_ttystate;
struct serial;
struct serial_ops;
+/* Speed in bits per second, or -1 which means don't mess with the speed. */
+
+extern int baud_rate;
+
+/* Parity for serial port */
+
+extern int serial_parity;
+
/* Create a new serial for OPS. The new serial is not opened. */
/* Try to open NAME. Returns a new `struct serial *' on success, NULL
diff --git a/gdb/target.h b/gdb/target.h
index e1a1d7a9226b..40bf416cd677 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -2477,12 +2477,6 @@ extern gdb::optional<gdb::char_vector> target_get_osdata (const char *type);
information (higher values, more information). */
extern int remote_debug;
-/* Speed in bits per second, or -1 which means don't mess with the speed. */
-extern int baud_rate;
-
-/* Parity for serial port */
-extern int serial_parity;
-
/* Timeout limit for response from target. */
extern int remote_timeout;
--
2.29.2
next reply other threads:[~2021-01-12 5:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 5:44 Simon Marchi via Gdb-patches [this message]
2021-01-12 5:44 ` [PATCH 2/2] gdb: move read{now, never}_symbol_files declarations to symfile.h Simon Marchi via Gdb-patches
2021-01-12 14:58 ` Christian Biesinger via Gdb-patches
2021-01-12 15:42 ` Simon Marchi via Gdb-patches
2021-01-12 18:28 ` Tom Tromey
2021-01-12 19:20 ` Simon Marchi via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210112054441.1188693-1-simon.marchi@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox