[Lldb-commits] [lldb] [lldb] Remove ConstString from UnwindLLDB (PR #229614)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 6 17:11:05 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/229614.diff
3 Files Affected:
- (modified) lldb/include/lldb/Target/UnwindLLDB.h (+4-5)
- (modified) lldb/source/Target/RegisterContextUnwind.cpp (+7-5)
- (modified) lldb/source/Target/UnwindLLDB.cpp (+2-1)
``````````diff
diff --git a/lldb/include/lldb/Target/UnwindLLDB.h b/lldb/include/lldb/Target/UnwindLLDB.h
index 29b3ab9c9029858..63bc1fb2f1ccf7d 100644
--- a/lldb/include/lldb/Target/UnwindLLDB.h
+++ b/lldb/include/lldb/Target/UnwindLLDB.h
@@ -16,7 +16,6 @@
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/Unwind.h"
-#include "lldb/Utility/ConstString.h"
#include "lldb/lldb-public.h"
namespace lldb_private {
@@ -111,13 +110,13 @@ class UnwindLLDB : public lldb_private::Unwind {
///
/// The Platform is one source of trap handler function names; that
/// may be augmented via a setting. The setting needs to be converted
- /// into an array of ConstStrings before it can be used - we only want
+ /// into an array of strings before it can be used - we only want
/// to do that once per thread so it's here in the UnwindLLDB object.
///
/// \return
- /// Vector of ConstStrings of trap handler function names. May be
+ /// Vector of strings of trap handler function names. May be
/// empty.
- const std::vector<ConstString> &GetUserSpecifiedTrapHandlerFunctionNames() {
+ const std::vector<std::string> &GetUserSpecifiedTrapHandlerFunctionNames() {
return m_user_supplied_trap_handler_functions;
}
@@ -149,7 +148,7 @@ class UnwindLLDB : public lldb_private::Unwind {
// and m_frames.size()
// is how far we've currently gone.
- std::vector<ConstString> m_user_supplied_trap_handler_functions;
+ std::vector<std::string> m_user_supplied_trap_handler_functions;
// Check if Full UnwindPlan of First frame is valid or not.
// If not then try Fallback UnwindPlan of the frame. If Fallback
diff --git a/lldb/source/Target/RegisterContextUnwind.cpp b/lldb/source/Target/RegisterContextUnwind.cpp
index c2edf90e5d2df51..b1c0e424abdfb70 100644
--- a/lldb/source/Target/RegisterContextUnwind.cpp
+++ b/lldb/source/Target/RegisterContextUnwind.cpp
@@ -1315,11 +1315,13 @@ bool RegisterContextUnwind::IsTrapHandlerSymbol(
}
}
}
- const std::vector<ConstString> user_specified_trap_handler_names(
- m_parent_unwind.GetUserSpecifiedTrapHandlerFunctionNames());
- for (ConstString name : user_specified_trap_handler_names) {
- if ((m_sym_ctx.function && m_sym_ctx.function->GetName() == name) ||
- (m_sym_ctx.symbol && m_sym_ctx.symbol->GetName() == name)) {
+ const std::vector<std::string> &user_specified_trap_handler_names =
+ m_parent_unwind.GetUserSpecifiedTrapHandlerFunctionNames();
+ for (const std::string &name : user_specified_trap_handler_names) {
+ if ((m_sym_ctx.function &&
+ m_sym_ctx.function->GetName().GetStringRef() == name) ||
+ (m_sym_ctx.symbol &&
+ m_sym_ctx.symbol->GetName().GetStringRef() == name)) {
return true;
}
}
diff --git a/lldb/source/Target/UnwindLLDB.cpp b/lldb/source/Target/UnwindLLDB.cpp
index 180e062d297baf3..9a47b64a5ee2101 100644
--- a/lldb/source/Target/UnwindLLDB.cpp
+++ b/lldb/source/Target/UnwindLLDB.cpp
@@ -33,7 +33,8 @@ UnwindLLDB::UnwindLLDB(Thread &thread)
size_t count = args.GetArgumentCount();
for (size_t i = 0; i < count; i++) {
const char *func_name = args.GetArgumentAtIndex(i);
- m_user_supplied_trap_handler_functions.push_back(ConstString(func_name));
+ m_user_supplied_trap_handler_functions.push_back(
+ llvm::StringRef(func_name).str());
}
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/229614
More information about the lldb-commits
mailing list