aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-06 08:33:46 -0600
committerTom Tromey <tromey@adacore.com>2023-11-27 12:55:14 -0700
commitd69939bded50d76179f97284df35879a385cf8c0 (patch)
tree965bb45900e7a4442d3ce67e551d5cafe73e8691 /gdb/serial.c
parenta2e0acea420cca881296c6fcf58920f3d7c05a45 (diff)
downloadgdb-d69939bded50d76179f97284df35879a385cf8c0.zip
gdb-d69939bded50d76179f97284df35879a385cf8c0.tar.gz
gdb-d69939bded50d76179f97284df35879a385cf8c0.tar.bz2
Change serial_send_break and serial_write to throw
This changes serial_send_break and serial_write to throw exceptions rather than attempt to set errno and return an error indicator. This lets us correctly report failures on Windows. Both functions had to be converted in a single patch because one implementation of send_break works via write. This also introduces remote_serial_send_break to handle error checking when attempting to send a break. This was previously ignored. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30770
Diffstat (limited to 'gdb/serial.c')
-rw-r--r--gdb/serial.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/serial.c b/gdb/serial.c
index 720af1a..e8ad339 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -399,7 +399,7 @@ serial_readchar (struct serial *scb, int timeout)
return (ch);
}
-int
+void
serial_write (struct serial *scb, const void *buf, size_t count)
{
if (serial_logfp != NULL)
@@ -428,7 +428,7 @@ serial_write (struct serial *scb, const void *buf, size_t count)
gdb_flush (gdb_stdlog);
}
- return (scb->ops->write (scb, buf, count));
+ scb->ops->write (scb, buf, count);
}
void
@@ -461,13 +461,13 @@ serial_flush_input (struct serial *scb)
return scb->ops->flush_input (scb);
}
-int
+void
serial_send_break (struct serial *scb)
{
if (serial_logfp != NULL)
serial_logchar (serial_logfp, 'w', SERIAL_BREAK, 0);
- return (scb->ops->send_break (scb));
+ scb->ops->send_break (scb);
}
void