Author: cem Date: Tue Aug 18 20:59:10 2020 New Revision: 364358 URL: https://svnweb.freebsd.org/changeset/base/364358
Log: 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 Modified: head/sys/gdb/gdb_main.c Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Tue Aug 18 20:41:03 2020 (r364357) +++ head/sys/gdb/gdb_main.c Tue Aug 18 20:59:10 2020 (r364358) @@ -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); _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"