llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: None (jimingham) <details> <summary>Changes</summary> 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. --- Full diff: https://github.com/llvm/llvm-project/pull/180255.diff 2 Files Affected: - (modified) lldb/include/lldb/Target/Process.h (+4-2) - (modified) lldb/source/Target/Process.cpp (+2-2) ``````````diff 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); `````````` </details> https://github.com/llvm/llvm-project/pull/180255 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
