diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h @@ -58,6 +58,11 @@ llvm::StringRef payload, StringExtractorGDBRemote &response, std::chrono::seconds interrupt_timeout = std::chrono::seconds(0)); + PacketResult ReadPacketWithOutputSupport( + StringExtractorGDBRemote &response, Timeout timeout, + bool sync_on_timeout, + llvm::function_ref output_callback); + PacketResult SendPacketAndReceiveResponseWithOutputSupport( llvm::StringRef payload, StringExtractorGDBRemote &response, std::chrono::seconds interrupt_timeout, diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp @@ -194,6 +194,23 @@ return SendPacketAndWaitForResponseNoLock(payload, response); } +GDBRemoteCommunication::PacketResult +GDBRemoteClientBase::ReadPacketWithOutputSupport( + StringExtractorGDBRemote &response, Timeout timeout, + bool sync_on_timeout, + llvm::function_ref output_callback) { + auto result = ReadPacket(response, timeout, sync_on_timeout); + while (result == PacketResult::Success && response.IsNormalResponse() && + response.PeekChar() == 'O') { + response.GetChar(); + std::string output; + if (response.GetHexByteString(output)) + output_callback(output); + result = ReadPacket(response, timeout, sync_on_timeout); + } + return result; +} + GDBRemoteCommunication::PacketResult GDBRemoteClientBase::SendPacketAndReceiveResponseWithOutputSupport( llvm::StringRef payload, StringExtractorGDBRemote &response, diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -190,11 +190,6 @@ PacketResult ReadPacket(StringExtractorGDBRemote &response, Timeout timeout, bool sync_on_timeout); - PacketResult ReadPacketWithOutputSupport( - StringExtractorGDBRemote &response, Timeout timeout, - bool sync_on_timeout, - llvm::function_ref output_callback); - PacketResult WaitForPacketNoLock(StringExtractorGDBRemote &response, Timeout timeout, bool sync_on_timeout); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -220,23 +220,6 @@ return result; } -GDBRemoteCommunication::PacketResult -GDBRemoteCommunication::ReadPacketWithOutputSupport( - StringExtractorGDBRemote &response, Timeout timeout, - bool sync_on_timeout, - llvm::function_ref output_callback) { - auto result = ReadPacket(response, timeout, sync_on_timeout); - while (result == PacketResult::Success && response.IsNormalResponse() && - response.PeekChar() == 'O') { - response.GetChar(); - std::string output; - if (response.GetHexByteString(output)) - output_callback(output); - result = ReadPacket(response, timeout, sync_on_timeout); - } - return result; -} - GDBRemoteCommunication::PacketResult GDBRemoteCommunication::ReadPacket(StringExtractorGDBRemote &response, Timeout timeout,