gdb(4): Support empty qSupported queries
Technically a client may send a qSupported query without specifying any client features. We should respond with our supported list in that case instead of bailing with error. Reported by: rlibby Reviewed by: emaste, rlibby, vangyzen Sponsored by: Isilon Differential Revision: https://reviews.freebsd.org/D26115
This commit is contained in:
+8
-1
@@ -204,8 +204,14 @@ gdb_do_qsupported(uint32_t *feat)
|
||||
|
||||
/* Parse supported host features */
|
||||
*feat = 0;
|
||||
if (gdb_rx_char() != ':')
|
||||
switch (gdb_rx_char()) {
|
||||
case ':':
|
||||
break;
|
||||
case EOF:
|
||||
goto nofeatures;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
while (gdb_rxsz > 0) {
|
||||
tok = gdb_rxp;
|
||||
@@ -250,6 +256,7 @@ gdb_do_qsupported(uint32_t *feat)
|
||||
*feat |= BIT(i);
|
||||
}
|
||||
|
||||
nofeatures:
|
||||
/* Send a supported feature list back */
|
||||
gdb_tx_begin(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user