aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-08-28 10:17:32 -0600
committerTom Tromey <tromey@adacore.com>2023-08-29 08:14:18 -0600
commitef6a98437852a4080bcb3e5c8036c9dae2b2c75c (patch)
tree466a739a34ad6e2283a4002ebcbec34d65ac82dd /gdb/remote.c
parent74b180e0d8e086723b79f596826a4e1df7c3b802 (diff)
downloadgdb-ef6a98437852a4080bcb3e5c8036c9dae2b2c75c.zip
gdb-ef6a98437852a4080bcb3e5c8036c9dae2b2c75c.tar.gz
gdb-ef6a98437852a4080bcb3e5c8036c9dae2b2c75c.tar.bz2
Remove expecting_notif parameter from getpkt_or_notif_sane_1
For getpkt_or_notif_sane_1, expecting_notif is redundant, because it always reflects whether the is_notif parameter is non-NULL. This patch removes the redundant parameter. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 29aff71..5f40586 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1214,7 +1214,7 @@ public: /* Remote specific methods. */
void skip_frame ();
long read_frame (gdb::char_vector *buf_p);
int getpkt_or_notif_sane_1 (gdb::char_vector *buf, int forever,
- int expecting_notif, int *is_notif);
+ int *is_notif);
int getpkt (gdb::char_vector *buf, int forever);
int getpkt_or_notif_sane (gdb::char_vector *buf, int forever,
int *is_notif);
@@ -10049,14 +10049,15 @@ show_watchdog (struct ui_file *file, int from_tty,
synchronous mode) to wait for a target that is is executing user
code to stop. If FOREVER == 0, this function is allowed to time
out gracefully and return an indication of this to the caller.
- Otherwise return the number of bytes read. If EXPECTING_NOTIF,
- consider receiving a notification enough reason to return to the
- caller. *IS_NOTIF is an output boolean that indicates whether *BUF
- holds a notification or not (a regular packet). */
+ Otherwise return the number of bytes read. If IS_NOTIF is not
+ NULL, then consider receiving a notification enough reason to
+ return to the caller. In this case, *IS_NOTIF is an output boolean
+ that indicates whether *BUF holds a notification or not (a regular
+ packet). */
int
remote_target::getpkt_or_notif_sane_1 (gdb::char_vector *buf,
- int forever, int expecting_notif,
+ int forever,
int *is_notif)
{
struct remote_state *rs = get_remote_state ();
@@ -10069,7 +10070,7 @@ remote_target::getpkt_or_notif_sane_1 (gdb::char_vector *buf,
if (forever)
timeout = watchdog > 0 ? watchdog : -1;
- else if (expecting_notif)
+ else if (is_notif != nullptr)
timeout = 0; /* There should already be a char in the buffer. If
not, bail out. */
else
@@ -10100,7 +10101,7 @@ remote_target::getpkt_or_notif_sane_1 (gdb::char_vector *buf,
if (c == SERIAL_TIMEOUT)
{
- if (expecting_notif)
+ if (is_notif != nullptr)
return -1; /* Don't complain, it's normal to not get
anything in this case. */
@@ -10188,7 +10189,7 @@ remote_target::getpkt_or_notif_sane_1 (gdb::char_vector *buf,
/* Notifications require no acknowledgement. */
- if (expecting_notif)
+ if (is_notif != nullptr)
return val;
}
}
@@ -10203,14 +10204,14 @@ remote_target::getpkt_or_notif_sane_1 (gdb::char_vector *buf,
int
remote_target::getpkt (gdb::char_vector *buf, int forever)
{
- return getpkt_or_notif_sane_1 (buf, forever, 0, NULL);
+ return getpkt_or_notif_sane_1 (buf, forever, NULL);
}
int
remote_target::getpkt_or_notif_sane (gdb::char_vector *buf, int forever,
int *is_notif)
{
- return getpkt_or_notif_sane_1 (buf, forever, 1, is_notif);
+ return getpkt_or_notif_sane_1 (buf, forever, is_notif);
}
/* Kill any new fork children of inferior INF that haven't been