diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/Process.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Target/Process.cpp | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/Process.cpp b/contrib/llvm/tools/lldb/source/Target/Process.cpp index 4194282..3abae4f 100644 --- a/contrib/llvm/tools/lldb/source/Target/Process.cpp +++ b/contrib/llvm/tools/lldb/source/Target/Process.cpp @@ -693,7 +693,7 @@ Process::GetStaticBroadcasterClass () // Process constructor //---------------------------------------------------------------------- Process::Process(Target &target, Listener &listener) : - Process(target, listener, Host::GetUnixSignals ()) + Process(target, listener, UnixSignals::Create(HostInfo::GetArchitecture())) { // This constructor just delegates to the full Process constructor, // defaulting to using the Host's UnixSignals. @@ -754,6 +754,7 @@ Process::Process(Target &target, Listener &listener, const UnixSignalsSP &unix_s m_force_next_event_delivery (false), m_last_broadcast_state (eStateInvalid), m_destroy_in_process (false), + m_can_interpret_function_calls(false), m_can_jit(eCanJITDontKnow) { CheckInWithManager (); @@ -763,14 +764,14 @@ Process::Process(Target &target, Listener &listener, const UnixSignalsSP &unix_s log->Printf ("%p Process::Process()", static_cast<void*>(this)); if (!m_unix_signals_sp) - m_unix_signals_sp.reset (new UnixSignals ()); + m_unix_signals_sp = std::make_shared<UnixSignals>(); SetEventName (eBroadcastBitStateChanged, "state-changed"); SetEventName (eBroadcastBitInterrupt, "interrupt"); SetEventName (eBroadcastBitSTDOUT, "stdout-available"); SetEventName (eBroadcastBitSTDERR, "stderr-available"); SetEventName (eBroadcastBitProfileData, "profile-data-available"); - + m_private_state_control_broadcaster.SetEventName (eBroadcastInternalStateControlStop , "control-stop" ); m_private_state_control_broadcaster.SetEventName (eBroadcastInternalStateControlPause , "control-pause" ); m_private_state_control_broadcaster.SetEventName (eBroadcastInternalStateControlResume, "control-resume"); @@ -1145,6 +1146,7 @@ Process::HandleProcessStateChangedEvent (const EventSP &event_sp, // Prefer a thread that has just completed its plan over another thread as current thread. ThreadSP plan_thread; ThreadSP other_thread; + const size_t num_threads = thread_list.GetSize(); size_t i; for (i = 0; i < num_threads; ++i) @@ -1157,10 +1159,22 @@ Process::HandleProcessStateChangedEvent (const EventSP &event_sp, case eStopReasonNone: break; + case eStopReasonSignal: + { + // Don't select a signal thread if we weren't going to stop at that + // signal. We have to have had another reason for stopping here, and + // the user doesn't want to see this thread. + uint64_t signo = thread->GetStopInfo()->GetValue(); + if (process_sp->GetUnixSignals()->GetShouldStop(signo)) + { + if (!other_thread) + other_thread = thread; + } + break; + } case eStopReasonTrace: case eStopReasonBreakpoint: case eStopReasonWatchpoint: - case eStopReasonSignal: case eStopReasonException: case eStopReasonExec: case eStopReasonThreadExiting: @@ -1510,7 +1524,7 @@ Process::SetProcessExitStatus (void *callback_baton, { const char *signal_cstr = NULL; if (signo) - signal_cstr = process_sp->GetUnixSignals().GetSignalAsCString (signo); + signal_cstr = process_sp->GetUnixSignals()->GetSignalAsCString(signo); process_sp->SetExitStatus (exit_status, signal_cstr); } @@ -2998,6 +3012,13 @@ Process::SetCanJIT (bool can_jit) m_can_jit = (can_jit ? eCanJITYes : eCanJITNo); } +void +Process::SetCanRunCode (bool can_run_code) +{ + SetCanJIT(can_run_code); + m_can_interpret_function_calls = can_run_code; +} + Error Process::DeallocateMemory (addr_t ptr) { @@ -4088,11 +4109,11 @@ Process::SetUnixSignals (const UnixSignalsSP &signals_sp) m_unix_signals_sp = signals_sp; } -UnixSignals & +const lldb::UnixSignalsSP & Process::GetUnixSignals () { assert (m_unix_signals_sp && "null m_unix_signals_sp"); - return *m_unix_signals_sp; + return m_unix_signals_sp; } lldb::ByteOrder |