[Lldb-commits] [lldb] [LLDB][NFC] use llvm::StringRef instead of std::string (PR #176748)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 19 05:04:29 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Ebuka Ezike (da-viper)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/176748.diff
1 Files Affected:
- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (+7-7)
``````````diff
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;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/176748
More information about the lldb-commits
mailing list