[Lldb-commits] [lldb] 7cb370d - [lldb] Replace ConstString with std::string in BreakpointName (#205910)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 25 15:50:22 PDT 2026
Author: Alex Langford
Date: 2026-06-25T15:50:18-07:00
New Revision: 7cb370ddf4e5dbd40bd529a6625024cadeaa13d7
URL: https://github.com/llvm/llvm-project/commit/7cb370ddf4e5dbd40bd529a6625024cadeaa13d7
DIFF: https://github.com/llvm/llvm-project/commit/7cb370ddf4e5dbd40bd529a6625024cadeaa13d7.diff
LOG: [lldb] Replace ConstString with std::string in BreakpointName (#205910)
Added:
Modified:
lldb/include/lldb/Breakpoint/BreakpointName.h
lldb/source/Target/Target.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Breakpoint/BreakpointName.h b/lldb/include/lldb/Breakpoint/BreakpointName.h
index 6ddca88644e46..cd66273fa91fe 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointName.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointName.h
@@ -137,18 +137,17 @@ class BreakpointName {
}
};
- BreakpointName(ConstString name, const char *help = nullptr) :
- m_name(name), m_options(false)
- {
- SetHelp(help);
- }
+ BreakpointName(std::string name, const char *help = nullptr)
+ : m_name(std::move(name)), m_options(false) {
+ SetHelp(help);
+ }
BreakpointName(const BreakpointName &rhs) :
m_name(rhs.m_name), m_options(rhs.m_options),
m_permissions(rhs.m_permissions), m_help(rhs.m_help)
{}
- ConstString GetName() const { return m_name; }
+ llvm::StringRef GetName() const { return m_name; }
BreakpointOptions &GetOptions() { return m_options; }
const BreakpointOptions &GetOptions() const { return m_options; }
@@ -186,10 +185,10 @@ class BreakpointName {
void ConfigureBreakpoint(lldb::BreakpointSP bp_sp);
private:
- ConstString m_name;
- BreakpointOptions m_options;
- Permissions m_permissions;
- std::string m_help;
+ std::string m_name;
+ BreakpointOptions m_options;
+ Permissions m_permissions;
+ std::string m_help;
};
} // namespace lldb_private
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index ea5d203a90266..a514546589c09 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -900,7 +900,8 @@ BreakpointName *Target::FindBreakpointName(ConstString name, bool can_create,
}
return m_breakpoint_names
- .insert(std::make_pair(name, std::make_unique<BreakpointName>(name)))
+ .insert(std::make_pair(
+ name, std::make_unique<BreakpointName>(name.GetStringRef().str())))
.first->second.get();
}
@@ -930,7 +931,7 @@ void Target::ConfigureBreakpointName(
void Target::ApplyNameToBreakpoints(BreakpointName &bp_name) {
llvm::Expected<std::vector<BreakpointSP>> expected_vector =
- m_breakpoint_list.FindBreakpointsByName(bp_name.GetName().GetStringRef());
+ m_breakpoint_list.FindBreakpointsByName(bp_name.GetName());
if (!expected_vector) {
LLDB_LOG(GetLog(LLDBLog::Breakpoints), "invalid breakpoint name: {}",
More information about the lldb-commits
mailing list