Skip to content

Commit 6d48e25

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
1 parent 10eb32f commit 6d48e25

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
@@ -1109,9 +1109,8 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
11091109

11101110
if (avail_type != CompressionType::None) {
11111111
StringExtractorGDBRemote response;
1112-
llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
1113-
if (SendPacketAndWaitForResponse(packet.str(), response) !=
1114-
PacketResult::Success)
1112+
std::string packet = "QEnableCompression:type:" + avail_name.str() + ";";
1113+
if (SendPacketAndWaitForResponse(packet, response) != PacketResult::Success)
11151114
return;
11161115

11171116
if (response.IsOKResponse()) {

0 commit comments

Comments
 (0)