aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-12-16 14:39:37 -0800
committerKazu Hirata <kazu@google.com>2023-12-16 14:39:37 -0800
commit744f38913fa380580431df0ae89ef5fb3df30240 (patch)
tree538d4e6bc7bf3d7c8d69232316ff89b82e1a2d7a /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
parent01c8af573961c54f0d922c3f3acffa880a0a459c (diff)
downloadllvm-744f38913fa380580431df0ae89ef5fb3df30240.zip
llvm-744f38913fa380580431df0ae89ef5fb3df30240.tar.gz
llvm-744f38913fa380580431df0ae89ef5fb3df30240.tar.bz2
[lldb] Use StringRef::{starts,ends}_with (NFC)
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 187c23a..3d37bb2 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -3921,7 +3921,7 @@ GDBRemoteCommunicationServerLLGS::Handle_qSaveCore(
std::string path_hint;
StringRef packet_str{packet.GetStringRef()};
- assert(packet_str.startswith("qSaveCore"));
+ assert(packet_str.starts_with("qSaveCore"));
if (packet_str.consume_front("qSaveCore;")) {
for (auto x : llvm::split(packet_str, ';')) {
if (x.consume_front("path-hint:"))
@@ -3947,7 +3947,7 @@ GDBRemoteCommunicationServerLLGS::Handle_QNonStop(
Log *log = GetLog(LLDBLog::Process);
StringRef packet_str{packet.GetStringRef()};
- assert(packet_str.startswith("QNonStop:"));
+ assert(packet_str.starts_with("QNonStop:"));
packet_str.consume_front("QNonStop:");
if (packet_str == "0") {
if (m_non_stop)
@@ -4306,7 +4306,7 @@ lldb_private::process_gdb_remote::LLGSArgToURL(llvm::StringRef url_arg,
std::string host_port = url_arg.str();
// If host_and_port starts with ':', default the host to be "localhost" and
// expect the remainder to be the port.
- if (url_arg.startswith(":"))
+ if (url_arg.starts_with(":"))
host_port.insert(0, "localhost");
// Try parsing the (preprocessed) argument as host:port pair.