diff options
author | Vikas Pachdha <vikas.pachdha@qt.io> | 2016-09-14 14:31:27 +0200 |
---|---|---|
committer | Vikas Pachdha <vikas.pachdha@qt.io> | 2016-09-14 14:17:40 +0000 |
commit | 1787d00e6e671a7475c8bba7193275c4a3439297 (patch) | |
tree | 0e1d109e15c73427d947e53bee5d58f7357576fd | |
parent | 95fa0e397b87706dfb6f220293f25a888cc824de (diff) | |
download | qt-creator-1787d00e6e671a7475c8bba7193275c4a3439297.tar.gz |
Continue process after lldb attach
lldb stops the process after attaching and the event loop is not yet started.
This makes the debugger wait for events while process is in stopped state
Task-number: QTCREATORBUG-15705
Change-Id: Iae6fe94fc483d963b377582c4cbbb443be5e6cba
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | share/qtcreator/debugger/lldbbridge.py | 9 | ||||
-rw-r--r-- | src/plugins/debugger/lldb/lldbengine.cpp | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 7a20042c40..f63605e3a8 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -711,8 +711,13 @@ class Dumper(DumperBase): self.report('pid="%s"' % self.process.GetProcessID()) # Even if it stops it seems that LLDB assumes it is running # and later detects that it did stop after all, so it is be - # better to mirror that and wait for the spontaneous stop. - self.reportState("enginerunandinferiorrunok") + # better to mirror that and wait for the spontaneous stop + if self.process and self.process.GetState() == lldb.eStateStopped: + # lldb stops the process after attaching. This happens before the + # eventloop starts. Relay the correct state back. + self.reportState("enginerunandinferiorstopok") + else: + self.reportState("enginerunandinferiorrunok") elif self.startMode_ == AttachToRemoteServer or self.startMode_ == AttachToRemoteProcess: self.process = self.target.ConnectRemote( self.debugger.GetListener(), diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 92b4ae97a2..d081383efc 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -937,9 +937,10 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState) if (runParameters().continueAfterAttach) m_continueAtNextSpontaneousStop = true; notifyEngineRunAndInferiorRunOk(); - } else if (newState == "enginerunandinferiorstopok") + } else if (newState == "enginerunandinferiorstopok") { notifyEngineRunAndInferiorStopOk(); - else if (newState == "enginerunokandinferiorunrunnable") + continueInferior(); + } else if (newState == "enginerunokandinferiorunrunnable") notifyEngineRunOkAndInferiorUnrunnable(); else if (newState == "inferiorshutdownok") notifyInferiorShutdownOk(); |