diff options
author | Dawn Perchik <dawn@burble.org> | 2015-09-17 17:55:32 +0000 |
---|---|---|
committer | Dawn Perchik <dawn@burble.org> | 2015-09-17 17:55:32 +0000 |
commit | 554a85711cd9726411660fed7bc825ae77fbe94e (patch) | |
tree | 3a1d51dc32ccc84efe980c66e111e992fc937ed5 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 0537f41de5666d2632468462327f800734f49940 (diff) | |
download | bcm5719-llvm-554a85711cd9726411660fed7bc825ae77fbe94e.tar.gz bcm5719-llvm-554a85711cd9726411660fed7bc825ae77fbe94e.zip |
Fix LLDB RSP client to decode '$O' packets incorrectly
Character with ASCII code 0 is incorrectly treated by LLDB as the end of
RSP packet. The left of the debugger server output is silently ignored.
Patch from evgeny.leviant@gmail.com
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12523
llvm-svn: 247908
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index ab0867ded61..95408073bf5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1262,9 +1262,13 @@ GDBRemoteCommunicationClient::SendContinuePacketAndWaitForResponse got_async_packet = true; std::string inferior_stdout; inferior_stdout.reserve(response.GetBytesLeft () / 2); - char ch; - while ((ch = response.GetHexU8()) != '\0') - inferior_stdout.append(1, ch); + + uint8_t ch; + while (response.GetHexU8Ex(ch)) + { + if (ch != 0) + inferior_stdout.append(1, (char)ch); + } process->AppendSTDOUT (inferior_stdout.c_str(), inferior_stdout.size()); } break; |