diff options
Diffstat (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel')
4 files changed, 17 insertions, 67 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 401fd9a48f9..a84122079e3 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -185,7 +185,7 @@ ProcessKDP::DoConnectRemote (const char *remote_url) kernel_arch.SetArchitecture(eArchTypeMachO, cpu, sub); m_target.SetArchitecture(kernel_arch); SetID (1); - UpdateThreadListIfNeeded (); + GetThreadList (); SetPrivateState (eStateStopped); StreamSP async_strm_sp(m_target.GetDebugger().GetAsyncOutputStream()); if (async_strm_sp) @@ -289,34 +289,28 @@ ProcessKDP::DoResume () } uint32_t -ProcessKDP::UpdateThreadListIfNeeded () +ProcessKDP::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) { // locker will keep a mutex locked until it goes out of scope LogSP log (ProcessKDPLog::GetLogIfAllCategoriesSet (KDP_LOG_THREAD)); if (log && log->GetMask().Test(KDP_LOG_VERBOSE)) log->Printf ("ProcessKDP::%s (pid = %i)", __FUNCTION__, GetID()); - Mutex::Locker locker (m_thread_list.GetMutex ()); - const uint32_t stop_id = GetStopID(); - if (m_thread_list.GetSize(false) == 0) + // We currently are making only one thread per core and we + // actually don't know about actual threads. Eventually we + // want to get the thread list from memory and note which + // threads are on CPU as those are the only ones that we + // will be able to resume. + const uint32_t cpu_mask = m_comm.GetCPUMask(); + for (uint32_t cpu_mask_bit = 1; cpu_mask_bit & cpu_mask; cpu_mask_bit <<= 1) { - // We currently are making only one thread per core and we - // actually don't know about actual threads. Eventually we - // want to get the thread list from memory and note which - // threads are on CPU as those are the only ones that we - // will be able to resume. - ThreadList curr_thread_list (this); - curr_thread_list.SetStopID(stop_id); - const uint32_t cpu_mask = m_comm.GetCPUMask(); - for (uint32_t cpu_mask_bit = 1; cpu_mask_bit & cpu_mask; cpu_mask_bit <<= 1) - { - // The thread ID is currently the CPU mask bit - ThreadSP thread_sp (new ThreadKDP (*this, cpu_mask_bit)); - curr_thread_list.AddThread(thread_sp); - } - m_thread_list = curr_thread_list; + lldb::tid_t tid = cpu_mask_bit; + ThreadSP thread_sp (old_thread_list.FindThreadByID (tid, false)); + if (!thread_sp) + thread_sp.reset(new ThreadKDP (*this, tid)); + new_thread_list.AddThread(thread_sp); } - return GetThreadList().GetSize(false); + return new_thread_list.GetSize(false); } diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h index 7f254d09e14..05907526594 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h @@ -233,7 +233,8 @@ protected: Clear ( ); uint32_t - UpdateThreadListIfNeeded (); + UpdateThreadList (lldb_private::ThreadList &old_thread_list, + lldb_private::ThreadList &new_thread_list); enum { diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp index dac551762f3..d0c4afd9fdd 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -28,11 +28,6 @@ #include "RegisterContextKDP_arm.h" #include "RegisterContextKDP_i386.h" #include "RegisterContextKDP_x86_64.h" -#include "Plugins/Process/Utility/UnwindLLDB.h" - -#if defined(__APPLE__) -#include "UnwindMacOSXFrameBackchain.h" -#endif using namespace lldb; using namespace lldb_private; @@ -56,14 +51,6 @@ ThreadKDP::~ThreadKDP () DestroyThread(); } - -const char * -ThreadKDP::GetInfo () -{ - return NULL; -} - - const char * ThreadKDP::GetName () { @@ -124,32 +111,6 @@ ThreadKDP::RefreshStateAfterStop() GetRegisterContext()->InvalidateIfNeeded (force); } -Unwind * -ThreadKDP::GetUnwinder () -{ - if (m_unwinder_ap.get() == NULL) - { - const ArchSpec target_arch (GetProcess().GetTarget().GetArchitecture ()); - const llvm::Triple::ArchType machine = target_arch.GetMachine(); - switch (machine) - { - case llvm::Triple::x86_64: - case llvm::Triple::x86: - case llvm::Triple::arm: - case llvm::Triple::thumb: - m_unwinder_ap.reset (new UnwindLLDB (*this)); - break; - - default: -#if defined(__APPLE__) - m_unwinder_ap.reset (new UnwindMacOSXFrameBackchain (*this)); -#endif - break; - } - } - return m_unwinder_ap.get(); -} - void ThreadKDP::ClearStackFrames () { diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h index 95c2f0577e4..a37fa91ee2b 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h @@ -33,9 +33,6 @@ public: RefreshStateAfterStop(); virtual const char * - GetInfo (); - - virtual const char * GetName (); virtual const char * @@ -103,9 +100,6 @@ protected: // Member variables. //------------------------------------------------------------------ - virtual lldb_private::Unwind * - GetUnwinder (); - virtual lldb::StopInfoSP GetPrivateStopReason (); |