diff --git a/gdb/remote.c b/gdb/remote.c index 88a57c8..8326ce8 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -11050,6 +11050,7 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes) char *buf = rs->buf; char *endbuf = rs->buf + get_remote_packet_size (); int nbytes; + int any = 0; buf += xsnprintf (buf, endbuf - buf, "QTNotes:"); if (user) @@ -11058,6 +11059,7 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes) nbytes = bin2hex (user, buf, 0); buf += 2 * nbytes; *buf++ = ';'; + any = 1; } if (notes) { @@ -11065,6 +11067,7 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes) nbytes = bin2hex (notes, buf, 0); buf += 2 * nbytes; *buf++ = ';'; + any = 1; } if (stop_notes) { @@ -11072,7 +11075,11 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes) nbytes = bin2hex (stop_notes, buf, 0); buf += 2 * nbytes; *buf++ = ';'; + any = 1; } + if (any == 0) + return 0; + /* Ensure the buffer is terminated. */ *buf = '\0';