diff options
author | Kazu Hirata <kazu@google.com> | 2024-05-16 20:47:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 20:47:12 -0700 |
commit | c33922666ce219fd6cb3341c3394f72050599552 (patch) | |
tree | 7b13826a8982993e46f96d0a9046b9c9e8dc0683 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | |
parent | 9f15aa009c36d2c108f0f2d09c2e9b283ebc4453 (diff) | |
download | llvm-c33922666ce219fd6cb3341c3394f72050599552.zip llvm-c33922666ce219fd6cb3341c3394f72050599552.tar.gz llvm-c33922666ce219fd6cb3341c3394f72050599552.tar.bz2 |
[lldb] Use operator==(StringRef, StringRef) instead of StringRef::equals (NFC) (#92476)
Note that StringRef::equals has been deprecated in favor of
operator==(StringRef, StringRef).
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index b4fb5b6..f9d3749 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -340,13 +340,13 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo( llvm::StringRef value; while (packet.GetNameColonValue(key, value)) { bool success = true; - if (key.equals("name")) { + if (key == "name") { StringExtractor extractor(value); std::string file; extractor.GetHexByteString(file); match_info.GetProcessInfo().GetExecutableFile().SetFile( file, FileSpec::Style::native); - } else if (key.equals("name_match")) { + } else if (key == "name_match") { NameMatch name_match = llvm::StringSwitch<NameMatch>(value) .Case("equals", NameMatch::Equals) .Case("starts_with", NameMatch::StartsWith) @@ -357,40 +357,40 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo( match_info.SetNameMatchType(name_match); if (name_match == NameMatch::Ignore) return SendErrorResponse(2); - } else if (key.equals("pid")) { + } else if (key == "pid") { lldb::pid_t pid = LLDB_INVALID_PROCESS_ID; if (value.getAsInteger(0, pid)) return SendErrorResponse(2); match_info.GetProcessInfo().SetProcessID(pid); - } else if (key.equals("parent_pid")) { + } else if (key == "parent_pid") { lldb::pid_t pid = LLDB_INVALID_PROCESS_ID; if (value.getAsInteger(0, pid)) return SendErrorResponse(2); match_info.GetProcessInfo().SetParentProcessID(pid); - } else if (key.equals("uid")) { + } else if (key == "uid") { uint32_t uid = UINT32_MAX; if (value.getAsInteger(0, uid)) return SendErrorResponse(2); match_info.GetProcessInfo().SetUserID(uid); - } else if (key.equals("gid")) { + } else if (key == "gid") { uint32_t gid = UINT32_MAX; if (value.getAsInteger(0, gid)) return SendErrorResponse(2); match_info.GetProcessInfo().SetGroupID(gid); - } else if (key.equals("euid")) { + } else if (key == "euid") { uint32_t uid = UINT32_MAX; if (value.getAsInteger(0, uid)) return SendErrorResponse(2); match_info.GetProcessInfo().SetEffectiveUserID(uid); - } else if (key.equals("egid")) { + } else if (key == "egid") { uint32_t gid = UINT32_MAX; if (value.getAsInteger(0, gid)) return SendErrorResponse(2); match_info.GetProcessInfo().SetEffectiveGroupID(gid); - } else if (key.equals("all_users")) { + } else if (key == "all_users") { match_info.SetMatchAllUsers( OptionArgParser::ToBoolean(value, false, &success)); - } else if (key.equals("triple")) { + } else if (key == "triple") { match_info.GetProcessInfo().GetArchitecture() = HostInfo::GetAugmentedArchSpec(value); } else { @@ -472,7 +472,7 @@ GDBRemoteCommunicationServerCommon::Handle_qSpeedTest( llvm::StringRef key; llvm::StringRef value; bool success = packet.GetNameColonValue(key, value); - if (success && key.equals("response_size")) { + if (success && key == "response_size") { uint32_t response_size = 0; if (!value.getAsInteger(0, response_size)) { if (response_size == 0) |