aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorAlex Langford <alangford@apple.com>2023-06-16 15:49:03 -0700
committerAlex Langford <alangford@apple.com>2023-06-21 10:17:24 -0700
commitb4827a3c0a7ef121ca376713e115b04eff0f5194 (patch)
tree47d4bf44cd5d6b7dfb0b098971f9cbf7b60ff6bc /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent74adc3e0ebfb42a48f02d8d7094d6848a37a21f5 (diff)
downloadllvm-b4827a3c0a7ef121ca376713e115b04eff0f5194.zip
llvm-b4827a3c0a7ef121ca376713e115b04eff0f5194.tar.gz
llvm-b4827a3c0a7ef121ca376713e115b04eff0f5194.tar.bz2
[lldb][NFCI] Remove ConstString from GDBRemoteCommunicationClient::ConfigureRemoteStructuredData
ConstString's benefits are not being utilized here, StringRef is sufficient. Differential Revision: https://reviews.llvm.org/D153177
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index d97e3a7..18aa98bc 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -4171,10 +4171,10 @@ Status GDBRemoteCommunicationClient::SendSignalsToIgnore(
}
Status GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(
- ConstString type_name, const StructuredData::ObjectSP &config_sp) {
+ llvm::StringRef type_name, const StructuredData::ObjectSP &config_sp) {
Status error;
- if (type_name.GetLength() == 0) {
+ if (type_name.empty()) {
error.SetErrorString("invalid type_name argument");
return error;
}
@@ -4182,7 +4182,7 @@ Status GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(
// Build command: Configure{type_name}: serialized config data.
StreamGDBRemote stream;
stream.PutCString("QConfigure");
- stream.PutCString(type_name.GetStringRef());
+ stream.PutCString(type_name);
stream.PutChar(':');
if (config_sp) {
// Gather the plain-text version of the configuration data.
@@ -4201,21 +4201,20 @@ Status GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(
auto result = SendPacketAndWaitForResponse(stream.GetString(), response);
if (result == PacketResult::Success) {
// We failed if the config result comes back other than OK.
- if (strcmp(response.GetStringRef().data(), "OK") == 0) {
+ if (response.GetStringRef() == "OK") {
// Okay!
error.Clear();
} else {
- error.SetErrorStringWithFormat("configuring StructuredData feature "
- "%s failed with error %s",
- type_name.AsCString(),
- response.GetStringRef().data());
+ error.SetErrorStringWithFormatv(
+ "configuring StructuredData feature {0} failed with error {1}",
+ type_name, response.GetStringRef());
}
} else {
// Can we get more data here on the failure?
- error.SetErrorStringWithFormat("configuring StructuredData feature %s "
- "failed when sending packet: "
- "PacketResult=%d",
- type_name.AsCString(), (int)result);
+ error.SetErrorStringWithFormatv(
+ "configuring StructuredData feature {0} failed when sending packet: "
+ "PacketResult={1}",
+ type_name, (int)result);
}
return error;
}