Convert some functions to use StringRef instead of c_str, len
This started as an effort to change StringExtractor to store a
StringRef internally instead of a std::string. I got that working
locally with just 1 test failure which I was unable to figure out the
cause of. But it was also a massive changelist due to a trickle
down effect of changes.
So I'm starting over, using what I learned from the first time to
tackle smaller, more isolated changes hopefully leading up to
a full conversion by the end.
At first the changes (such as in this CL) will seem mostly
a matter of preference and pointless otherwise. However, there
are some places in my larger CL where using StringRef turned 20+
lines of code into 2, drastically simplifying logic. Hopefully
once these go in they will illustrate some of the benefits of
thinking in terms of StringRef.
llvm-svn: 279917
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
index 1cac612..b56d771 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -247,7 +247,7 @@
StreamGDBRemote escaped_response;
escaped_response.PutEscapedBytes(response.GetData(), response.GetSize());
- return SendPacketNoLock(escaped_response.GetData(), escaped_response.GetSize());
+ return SendPacketNoLock(escaped_response.GetString());
}
GDBRemoteCommunication::PacketResult
@@ -353,7 +353,7 @@
StreamString response;
CreateProcessInfoResponse_DebugServerStyle(proc_info, response);
- return SendPacketNoLock (response.GetData (), response.GetSize ());
+ return SendPacketNoLock (response.GetString());
}
GDBRemoteCommunication::PacketResult
@@ -367,7 +367,7 @@
StreamString response;
response.PutBytesAsRawHex8(cwd, strlen(cwd));
- return SendPacketNoLock(response.GetData(), response.GetSize());
+ return SendPacketNoLock(response.GetString());
}
GDBRemoteCommunication::PacketResult
@@ -408,7 +408,7 @@
m_process_launch_info.Clear();
}
- return SendPacketNoLock (response.GetData(), response.GetSize());
+ return SendPacketNoLock (response.GetString());
}
GDBRemoteCommunication::PacketResult
@@ -437,7 +437,7 @@
StreamString response;
signal_array.Dump(response);
- return SendPacketNoLock(response.GetData(), response.GetSize());
+ return SendPacketNoLock(response.GetString());
}
bool