diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-07-21 19:27:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-14 16:53:09 -0700 |
commit | 1c7c045e442d5b2ac65b4cf20e6e942eaacc7079 (patch) | |
tree | 823fde1cbf8348dfd79292a2956f3d8b1a734ffc /kernel | |
parent | eddded6c0566797b36dd64a6fa7e72dc781dc353 (diff) | |
download | kernel-common-1c7c045e442d5b2ac65b4cf20e6e942eaacc7079.tar.gz kernel-common-1c7c045e442d5b2ac65b4cf20e6e942eaacc7079.tar.bz2 kernel-common-1c7c045e442d5b2ac65b4cf20e6e942eaacc7079.zip |
repair gdbstub to match the gdbserial protocol specification
commit fb82c0ff27b2c40c6f7a3d1a94cafb154591fa80 upstream.
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.
Backport-request-by: Frank Pan <frankpzh@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kgdb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/kgdb.c b/kernel/kgdb.c index 761fdd2b3034..c819a6dbc9ef 100644 --- a/kernel/kgdb.c +++ b/kernel/kgdb.c @@ -1017,10 +1017,8 @@ static void gdb_cmd_query(struct kgdb_state *ks) switch (remcom_in_buffer[1]) { case 's': case 'f': - if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) { - error_packet(remcom_out_buffer, -EINVAL); + if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) break; - } i = 0; remcom_out_buffer[0] = 'm'; @@ -1061,10 +1059,9 @@ static void gdb_cmd_query(struct kgdb_state *ks) pack_threadid(remcom_out_buffer + 2, thref); break; case 'T': - if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) { - error_packet(remcom_out_buffer, -EINVAL); + if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) break; - } + ks->threadid = 0; ptr = remcom_in_buffer + 17; kgdb_hex2long(&ptr, &ks->threadid); |