diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -1643,7 +1643,9 @@ return SendPacket("OK"); std::ostringstream ret_str; std::string status_str; - ret_str << "E" << m_ctx.LaunchStatusAsString(status_str); + std::string error_quoted = binary_encode_string + (m_ctx.LaunchStatusAsString(status_str)); + ret_str << "E" << error_quoted; return SendPacket(ret_str.str()); } @@ -2677,8 +2679,9 @@ std::string hex_str; hex_str.reserve (strlen (str) * 2); while (str && *str) { + uint8_t c = *str++; char hexbuf[5]; - snprintf (hexbuf, sizeof(hexbuf), "%02x", *str++); + snprintf (hexbuf, sizeof(hexbuf), "%02x", c); hex_str += hexbuf; } return hex_str;