Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163480360
D20308.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20308.diff
View Options
Index: head/usr.sbin/bhyve/gdb.c
===================================================================
--- head/usr.sbin/bhyve/gdb.c
+++ head/usr.sbin/bhyve/gdb.c
@@ -993,13 +993,72 @@
}
static void
+check_features(const uint8_t *data, size_t len)
+{
+ char *feature, *next_feature, *str, *value;
+ bool supported;
+
+ str = malloc(len + 1);
+ memcpy(str, data, len);
+ str[len] = '\0';
+ next_feature = str;
+
+ while ((feature = strsep(&next_feature, ";")) != NULL) {
+ /*
+ * Null features shouldn't exist, but skip if they
+ * do.
+ */
+ if (strcmp(feature, "") == 0)
+ continue;
+
+ /*
+ * Look for the value or supported / not supported
+ * flag.
+ */
+ value = strchr(feature, '=');
+ if (value != NULL) {
+ *value = '\0';
+ value++;
+ supported = true;
+ } else {
+ value = feature + strlen(feature) - 1;
+ switch (*value) {
+ case '+':
+ supported = true;
+ break;
+ case '-':
+ supported = false;
+ break;
+ default:
+ /*
+ * This is really a protocol error,
+ * but we just ignore malformed
+ * features for ease of
+ * implementation.
+ */
+ continue;
+ }
+ value = NULL;
+ }
+
+ /* No currently supported features. */
+ }
+ free(str);
+
+ start_packet();
+
+ /* This is an arbitrary limit. */
+ append_string("PacketSize=4096");
+ finish_packet();
+}
+
+static void
gdb_query(const uint8_t *data, size_t len)
{
/*
* TODO:
* - qSearch
- * - qSupported
*/
if (command_equals(data, len, "qAttached")) {
start_packet();
@@ -1037,6 +1096,10 @@
start_packet();
append_char('l');
finish_packet();
+ } else if (command_equals(data, len, "qSupported")) {
+ data += strlen("qSupported");
+ len -= strlen("qSupported");
+ check_features(data, len);
} else if (command_equals(data, len, "qThreadExtraInfo")) {
char buf[16];
int tid;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 2:56 PM (11 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35418155
Default Alt Text
D20308.diff (1 KB)
Attached To
Mode
D20308: Add initial support for qSupported.
Attached
Detach File
Event Timeline
Log In to Comment