Skip to content

Commit 4301f82

Browse files
committed
[lldb] Use std::string instead of llvm::Twine in GDBRemoteCommunicationClient
From the documentation: A Twine is not intended for use directly and should not be stored, its implementation relies on the ability to store pointers to temporary stack objects which may be deallocated at the end of a statement. Twines should only be used accepted as const references in arguments, when an API wishes to accept possibly-concatenated strings. rdar://84799118 Differential revision: https://reviews.llvm.org/D113314 (cherry picked from commit 6d48e25)
1 parent 9bffefe commit 4301f82

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,9 +1075,8 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
10751075

10761076
if (avail_type != CompressionType::None) {
10771077
StringExtractorGDBRemote response;
1078-
llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
1079-
if (SendPacketAndWaitForResponse(packet.str(), response) !=
1080-
PacketResult::Success)
1078+
std::string packet = "QEnableCompression:type:" + avail_name.str() + ";";
1079+
if (SendPacketAndWaitForResponse(packet, response) != PacketResult::Success)
10811080
return;
10821081

10831082
if (response.IsOKResponse()) {

0 commit comments

Comments
 (0)