https://github.com/jimingham updated https://github.com/llvm/llvm-project/pull/180255
>From a474123b49c0bf10afb15df8f159bedd6b8c2c7b Mon Sep 17 00:00:00 2001 From: Jim Ingham <[email protected]> Date: Fri, 6 Feb 2026 10:13:53 -0800 Subject: [PATCH 1/2] Cleanup the use of m_is_secondary_thread from PR #179799. This ivar was passed to the thread function for the private state thread - mostly because the equivalent variable was passed in in the original version of the code. But it was never used, so I didn't notice that the ivar equivalent wasn't being initialized. I'm going to keep the ivar because it will be useful when debugging to easily see whether you are on the main or secondary private state thread. So in this change, I set m_is_secondary_thread properly in the constructor, but remove passing it to the thread function since it wasn't needed there. --- lldb/include/lldb/Target/Process.h | 6 ++++-- lldb/source/Target/Process.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index e0b36fd1eb35e..40dcad808afa0 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -3213,7 +3213,9 @@ void PruneThreadPlans(); bool is_secondary_thread, // FIXME: Can I get rid of this? llvm::StringRef thread_name) : m_process(process), m_public_state(public_state), - m_private_state(private_state), m_thread_name(thread_name) {} + m_private_state(private_state), + m_is_secondary_thread(is_secondary_thread), m_thread_name(thread_name) + {} // This returns false if we couldn't start up the thread. If that happens, // you won't be doing any debugging today. bool StartupThread(); @@ -3544,7 +3546,7 @@ void PruneThreadPlans(); // temporarily spin up a secondary state thread to handle events from a hand- // called function on the primary private state thread. - lldb::thread_result_t RunPrivateStateThread(bool is_secondary_thread); + lldb::thread_result_t RunPrivateStateThread(); protected: void HandlePrivateEvent(lldb::EventSP &event_sp); diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 1f79a2830bd7b..6196b1a60caa7 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3916,7 +3916,7 @@ bool Process::PrivateStateThread::StartupThread() { ThreadLauncher::LaunchThread( m_thread_name, [this] { - return m_process.RunPrivateStateThread(m_is_secondary_thread); + return m_process.RunPrivateStateThread(); }, 8 * 1024 * 1024); if (!private_state_thread) { @@ -4196,7 +4196,7 @@ Status Process::HaltPrivate() { return error; } -thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) { +thread_result_t Process::RunPrivateStateThread() { bool control_only = true; Log *log = GetLog(LLDBLog::Process); >From 3ba8beb4f466f396daa91bbbb52698d1c7ea329d Mon Sep 17 00:00:00 2001 From: Jim Ingham <[email protected]> Date: Fri, 6 Feb 2026 10:25:19 -0800 Subject: [PATCH 2/2] formatting --- lldb/include/lldb/Target/Process.h | 6 +++--- lldb/source/Target/Process.cpp | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 40dcad808afa0..7a15adebc63ee 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -3213,9 +3213,9 @@ void PruneThreadPlans(); bool is_secondary_thread, // FIXME: Can I get rid of this? llvm::StringRef thread_name) : m_process(process), m_public_state(public_state), - m_private_state(private_state), - m_is_secondary_thread(is_secondary_thread), m_thread_name(thread_name) - {} + m_private_state(private_state), + m_is_secondary_thread(is_secondary_thread), + m_thread_name(thread_name) {} // This returns false if we couldn't start up the thread. If that happens, // you won't be doing any debugging today. bool StartupThread(); diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 6196b1a60caa7..0cd46f2fc7408 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3914,10 +3914,7 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) { bool Process::PrivateStateThread::StartupThread() { llvm::Expected<HostThread> private_state_thread = ThreadLauncher::LaunchThread( - m_thread_name, - [this] { - return m_process.RunPrivateStateThread(); - }, + m_thread_name, [this] { return m_process.RunPrivateStateThread(); }, 8 * 1024 * 1024); if (!private_state_thread) { LLDB_LOG_ERROR(GetLog(LLDBLog::Host), private_state_thread.takeError(), _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
