aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2024-04-19 14:37:56 +0100
committerPedro Alves <pedro@palves.net>2024-04-26 21:22:47 +0100
commitef27d39dd2c2e7b6af70884895e6d751872ae305 (patch)
tree50c48e1e648a68debcd8971b525ff0b9d8e314b2 /gdbserver
parentf1fc8dc2dccb4a224cdd1c3973c7a09a752aa95b (diff)
downloadgdb-ef27d39dd2c2e7b6af70884895e6d751872ae305.zip
gdb-ef27d39dd2c2e7b6af70884895e6d751872ae305.tar.gz
gdb-ef27d39dd2c2e7b6af70884895e6d751872ae305.tar.bz2
gdbserver: Fix vAttach response when attaching is not supported
handle_v_attach calls attach_inferior, which says: "return -1 if attaching is unsupported, 0 if it succeeded, and call error() otherwise." So if attach_inferior return != 0, we have the unsupported case, meaning we should return the empty packet instead of an error. In practice, this shouldn't trigger, as vAttach support is supposed to be reported via qSupported. But it doesn't hurt to be pedantic here. Change-Id: I99cce6fa678f2370571e6bca0657451300956127 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/server.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index 2633df0..789af36 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -3318,7 +3318,10 @@ handle_v_attach (char *own_buf)
prepare_resume_reply (own_buf, cs.last_ptid, cs.last_status);
}
else
- write_enn (own_buf);
+ {
+ /* Not supported. */
+ own_buf[0] = 0;
+ }
}
catch (const gdb_exception_error &exception)
{