Commit fb82c0ff authored by Jason Wessel's avatar Jason Wessel

repair gdbstub to match the gdbserial protocol specification

The gdbserial protocol handler should return an empty packet instead
of an error string when ever it responds to a command it does not
implement.

The problem cases come from a debugger client sending
qTBuffer, qTStatus, qSearch, qSupported.

The incorrect response from the gdbstub leads the debugger clients to
not function correctly.  Recent versions of gdb will not detach correctly as a result of this behavior.
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarDongdong Deng <dongdong.deng@windriver.com>
parent 1396a21b
...@@ -621,10 +621,8 @@ static void gdb_cmd_query(struct kgdb_state *ks) ...@@ -621,10 +621,8 @@ static void gdb_cmd_query(struct kgdb_state *ks)
switch (remcom_in_buffer[1]) { switch (remcom_in_buffer[1]) {
case 's': case 's':
case 'f': case 'f':
if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) { if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10))
error_packet(remcom_out_buffer, -EINVAL);
break; break;
}
i = 0; i = 0;
remcom_out_buffer[0] = 'm'; remcom_out_buffer[0] = 'm';
...@@ -665,10 +663,9 @@ static void gdb_cmd_query(struct kgdb_state *ks) ...@@ -665,10 +663,9 @@ static void gdb_cmd_query(struct kgdb_state *ks)
pack_threadid(remcom_out_buffer + 2, thref); pack_threadid(remcom_out_buffer + 2, thref);
break; break;
case 'T': case 'T':
if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) { if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16))
error_packet(remcom_out_buffer, -EINVAL);
break; break;
}
ks->threadid = 0; ks->threadid = 0;
ptr = remcom_in_buffer + 17; ptr = remcom_in_buffer + 17;
kgdb_hex2long(&ptr, &ks->threadid); kgdb_hex2long(&ptr, &ks->threadid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment