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:
Ilia K
2015-05-20 10:15:47 +00:00
parent 81496c1dec
commit 38810f430b
9 changed files with 127 additions and 16 deletions

View File

@@ -603,6 +603,30 @@ SBProcess::GetStopID(bool include_expression_stops)
return 0;
}
SBEvent
SBProcess::GetStopEventForStopID(uint32_t stop_id)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBEvent sb_event;
EventSP event_sp;
ProcessSP process_sp(GetSP());
if (process_sp)
{
Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
event_sp = process_sp->GetStopEventForStopID(stop_id);
sb_event.reset(event_sp);
}
if (log)
log->Printf ("SBProcess(%p)::GetStopEventForStopID (stop_id=%" PRIu32 ") => SBEvent(%p)",
static_cast<void*>(process_sp.get()),
stop_id,
static_cast<void*>(event_sp.get()));
return sb_event;
}
StateType
SBProcess::GetState ()
{