Changeset View
Changeset View
Standalone View
Standalone View
head/sys/gdb/gdb_main.c
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
gdb_do_qsupported(uint32_t *feat) | gdb_do_qsupported(uint32_t *feat) | ||||
{ | { | ||||
char *tok, *delim, ok; | char *tok, *delim, ok; | ||||
size_t i, toklen; | size_t i, toklen; | ||||
/* Parse supported host features */ | /* Parse supported host features */ | ||||
*feat = 0; | *feat = 0; | ||||
if (gdb_rx_char() != ':') | switch (gdb_rx_char()) { | ||||
case ':': | |||||
break; | |||||
case EOF: | |||||
goto nofeatures; | |||||
default: | |||||
goto error; | goto error; | ||||
} | |||||
while (gdb_rxsz > 0) { | while (gdb_rxsz > 0) { | ||||
tok = gdb_rxp; | tok = gdb_rxp; | ||||
delim = strchrnul(gdb_rxp, ';'); | delim = strchrnul(gdb_rxp, ';'); | ||||
toklen = (delim - tok); | toklen = (delim - tok); | ||||
gdb_rxp += toklen; | gdb_rxp += toklen; | ||||
gdb_rxsz -= toklen; | gdb_rxsz -= toklen; | ||||
Show All 28 Lines | while (gdb_rxsz > 0) { | ||||
if (i == nitems(gdb_feature_names)) { | if (i == nitems(gdb_feature_names)) { | ||||
/* Unknown GDB feature. */ | /* Unknown GDB feature. */ | ||||
continue; | continue; | ||||
} | } | ||||
*feat |= BIT(i); | *feat |= BIT(i); | ||||
} | } | ||||
nofeatures: | |||||
/* Send a supported feature list back */ | /* Send a supported feature list back */ | ||||
gdb_tx_begin(0); | gdb_tx_begin(0); | ||||
gdb_tx_str("PacketSize"); | gdb_tx_str("PacketSize"); | ||||
gdb_tx_char('='); | gdb_tx_char('='); | ||||
/* | /* | ||||
* We don't buffer framing bytes, but we do need to retain a byte for a | * We don't buffer framing bytes, but we do need to retain a byte for a | ||||
* trailing nul. | * trailing nul. | ||||
▲ Show 20 Lines • Show All 582 Lines • Show Last 20 Lines |