diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-21 04:55:56 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-21 04:55:56 +0000 |
commit | d35b42f20a48d6fd9c1f8fce095c37794d49806c (patch) | |
tree | 393063216884d10d5efef46472ada966725a2e85 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | |
parent | 7483005c59828482aa28e09c7a132628b4054e29 (diff) | |
download | bcm5719-llvm-d35b42f20a48d6fd9c1f8fce095c37794d49806c.tar.gz bcm5719-llvm-d35b42f20a48d6fd9c1f8fce095c37794d49806c.zip |
[NFC] Return llvm::StringRef from StringExtractor::GetStringRef.
This patch removes the two variant of StringExtractor::GetStringRef that
return (non-)const references to std::string. The non-const one was
being abused to reinitialize the StringExtractor and its uses are
replaced by calls to the copy asignment operator. The const variant was
refactored to return an actual llvm::StringRef.
llvm-svn: 369493
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index d137c4c39ec..ac6ecffcf85 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -59,14 +59,13 @@ GDBRemoteCommunicationServer::GetPacketAndSendResponse( break; case StringExtractorGDBRemote::eServerPacketType_unimplemented: - packet_result = SendUnimplementedResponse(packet.GetStringRef().c_str()); + packet_result = SendUnimplementedResponse(packet.GetStringRef().data()); break; default: auto handler_it = m_packet_handlers.find(packet_type); if (handler_it == m_packet_handlers.end()) - packet_result = - SendUnimplementedResponse(packet.GetStringRef().c_str()); + packet_result = SendUnimplementedResponse(packet.GetStringRef().data()); else packet_result = handler_it->second(packet, error, interrupt, quit); break; @@ -140,7 +139,7 @@ GDBRemoteCommunicationServer::SendIllFormedResponse( const StringExtractorGDBRemote &failed_packet, const char *message) { Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS)); LLDB_LOGF(log, "GDBRemoteCommunicationServer::%s: ILLFORMED: '%s' (%s)", - __FUNCTION__, failed_packet.GetStringRef().c_str(), + __FUNCTION__, failed_packet.GetStringRef().data(), message ? message : ""); return SendErrorResponse(0x03); } |