mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 13:35:38 +08:00
Fix handling of hijacked events in synchronous mode
Summary: This patch includes the following changes: * Fix Target::Launch to handle hijacked event in synchronous mode * Improve MiStartupOptionsTestCase tests to expect *stopped (MI) * Add SBProcess::GetStopEventForStopID * Add ProcessModID::SetStopEventForLastNaturalStopID/GetStopEventForStopID * Add const qualifier to ProcessModID::GetLastNaturalStopID * Add SBProcess::GetStopEventForStopID * Don't broadcast hijacked event in Target::Launch * Add CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent/RebroadcastStopEvent Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/startup_options/ Reviewers: zturner, jingham, clayborg, abidh Reviewed By: clayborg Subscribers: abidh, zturner, lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9371 llvm-svn: 237781
This commit is contained in:
@@ -1796,6 +1796,7 @@ Process::SetPrivateState (StateType new_state)
|
||||
if (state_changed)
|
||||
{
|
||||
m_private_state.SetValueNoLock (new_state);
|
||||
EventSP event_sp (new Event (eBroadcastBitStateChanged, new ProcessEventData (shared_from_this(), new_state)));
|
||||
if (StateIsStoppedState(new_state, false))
|
||||
{
|
||||
// Note, this currently assumes that all threads in the list
|
||||
@@ -1812,15 +1813,18 @@ Process::SetPrivateState (StateType new_state)
|
||||
m_thread_list.DidStop();
|
||||
|
||||
m_mod_id.BumpStopID();
|
||||
if (!m_mod_id.IsLastResumeForUserExpression())
|
||||
m_mod_id.SetStopEventForLastNaturalStopID(event_sp);
|
||||
m_memory_cache.Clear();
|
||||
if (log)
|
||||
log->Printf("Process::SetPrivateState (%s) stop_id = %u", StateAsCString(new_state), m_mod_id.GetStopID());
|
||||
}
|
||||
|
||||
// Use our target to get a shared pointer to ourselves...
|
||||
if (m_finalize_called && PrivateStateThreadIsValid() == false)
|
||||
BroadcastEvent (eBroadcastBitStateChanged, new ProcessEventData (shared_from_this(), new_state));
|
||||
BroadcastEvent (event_sp);
|
||||
else
|
||||
m_private_state_broadcaster.BroadcastEvent (eBroadcastBitStateChanged, new ProcessEventData (shared_from_this(), new_state));
|
||||
m_private_state_broadcaster.BroadcastEvent (event_sp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user