[Lldb-commits] [lldb] [lldb][NFC] Target::RemoveNameFromBreakpoint should take a StringRef (PR #206834)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 30 13:53:17 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Alex Langford (bulbazord)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/206834.diff
5 Files Affected:
- (modified) lldb/include/lldb/Breakpoint/Breakpoint.h (+2-2)
- (modified) lldb/include/lldb/Target/Target.h (+2-1)
- (modified) lldb/source/API/SBBreakpoint.cpp (+2-2)
- (modified) lldb/source/Commands/CommandObjectBreakpoint.cpp (+1-1)
- (modified) lldb/source/Target/Target.cpp (+2-2)
``````````diff
diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h
index c5baf3b87ee8e..14d3b17d272c7 100644
--- a/lldb/include/lldb/Breakpoint/Breakpoint.h
+++ b/lldb/include/lldb/Breakpoint/Breakpoint.h
@@ -560,8 +560,8 @@ class Breakpoint : public std::enable_shared_from_this<Breakpoint>,
private:
void AddName(llvm::StringRef new_name);
- void RemoveName(const char *name_to_remove) {
- if (name_to_remove)
+ void RemoveName(llvm::StringRef name_to_remove) {
+ if (!name_to_remove.empty())
m_name_list.erase(name_to_remove);
}
diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h
index 75dec7d0723a2..239b0d27f400d 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -961,7 +961,8 @@ class Target : public std::enable_shared_from_this<Target>,
void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
Status &error);
- void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name);
+ void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp,
+ llvm::StringRef name);
BreakpointName *FindBreakpointName(ConstString name, bool can_create,
Status &error);
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp
index 04af7a3aecdac..bcef2bd366f73 100644
--- a/lldb/source/API/SBBreakpoint.cpp
+++ b/lldb/source/API/SBBreakpoint.cpp
@@ -702,8 +702,8 @@ void SBBreakpoint::RemoveName(const char *name_to_remove) {
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
- bkpt_sp->GetTarget().RemoveNameFromBreakpoint(bkpt_sp,
- ConstString(name_to_remove));
+ bkpt_sp->GetTarget().RemoveNameFromBreakpoint(
+ bkpt_sp, llvm::StringRef(name_to_remove));
}
}
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 38b79d6c33922..a100627ac33a6 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -3109,7 +3109,7 @@ class CommandObjectBreakpointNameDelete : public CommandObjectParsed {
result.AppendError("no breakpoints specified, cannot delete names");
return;
}
- ConstString bp_name(m_name_options.m_name.GetCurrentValue());
+ llvm::StringRef bp_name(m_name_options.m_name.GetCurrentValueAsRef());
size_t num_valid_ids = valid_bp_ids.GetSize();
for (size_t index = 0; index < num_valid_ids; index++) {
lldb::break_id_t bp_id =
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 81ffb037ba673..cf96616e2c8f5 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -917,8 +917,8 @@ void Target::DeleteBreakpointName(ConstString name) {
}
void Target::RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp,
- ConstString name) {
- bp_sp->RemoveName(name.AsCString(nullptr));
+ llvm::StringRef name) {
+ bp_sp->RemoveName(name);
}
void Target::ConfigureBreakpointName(
``````````
</details>
https://github.com/llvm/llvm-project/pull/206834
More information about the lldb-commits
mailing list