https://github.com/da-viper created 
https://github.com/llvm/llvm-project/pull/176748

None

>From 6cc4f19e8280d58a90e5b2d579464d86e8ae6911 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <[email protected]>
Date: Mon, 19 Jan 2026 13:02:49 +0000
Subject: [PATCH] [LLDB][NFC] use llvm::StringRef instead of std::string

---
 .../Process/gdb-remote/ProcessGDBRemote.cpp        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index f91b59b48eb5c..0c61cf870d080 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1598,25 +1598,25 @@ bool ProcessGDBRemote::UpdateThreadIDList() {
     if (m_last_stop_packet) {
       // Get the thread stop info
       StringExtractorGDBRemote &stop_info = *m_last_stop_packet;
-      const std::string &stop_info_str = std::string(stop_info.GetStringRef());
+      const llvm::StringRef stop_info_str = stop_info.GetStringRef();
 
       m_thread_pcs.clear();
       const size_t thread_pcs_pos = stop_info_str.find(";thread-pcs:");
-      if (thread_pcs_pos != std::string::npos) {
+      if (thread_pcs_pos != llvm::StringRef::npos) {
         const size_t start = thread_pcs_pos + strlen(";thread-pcs:");
         const size_t end = stop_info_str.find(';', start);
-        if (end != std::string::npos) {
-          std::string value = stop_info_str.substr(start, end - start);
+        if (end != llvm::StringRef::npos) {
+          llvm::StringRef value = stop_info_str.substr(start, end - start);
           UpdateThreadPCsFromStopReplyThreadsValue(value);
         }
       }
 
       const size_t threads_pos = stop_info_str.find(";threads:");
-      if (threads_pos != std::string::npos) {
+      if (threads_pos != llvm::StringRef::npos) {
         const size_t start = threads_pos + strlen(";threads:");
         const size_t end = stop_info_str.find(';', start);
-        if (end != std::string::npos) {
-          std::string value = stop_info_str.substr(start, end - start);
+        if (end != llvm::StringRef::npos) {
+          llvm::StringRef value = stop_info_str.substr(start, end - start);
           if (UpdateThreadIDsFromStopReplyThreadsValue(value))
             return true;
         }

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to