void AttachGdbAdapter::handleAttach(const GdbResponse &response)
{
- QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (response.resultClass == GdbResultDone) {
- setState(InferiorStopped);
- debugMessage(_("INFERIOR STARTED"));
+ QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
+ debugMessage(_("INFERIOR ATTACHED"));
showStatusMessage(msgAttachedToStoppedInferior());
m_engine->updateAll();
} else {
const QByteArray reason = data.findChild("reason").data();
if (isExitedReason(reason)) {
- QTC_ASSERT(state() == InferiorRunning, /**/);
+ if (state() == InferiorRunning) {
+ setState(InferiorStopping);
+ } else {
+ // The user triggered a stop, but meanwhile the app simply exited ...
+ QTC_ASSERT(state() == InferiorStopping, qDebug() << state());
+ }
+ setState(InferiorStopped);
QString msg;
if (reason == "exited") {
msg = tr("Program exited with exit code %1.")
return;
}
+ if (state() == InferiorRunning) {
+ // Stop triggered by a breakpoint or otherwise not directly
+ // initiated by the user.
+ setState(InferiorStopping);
+ } else {
+ QTC_ASSERT(state() == InferiorStopping || state() == InferiorStarting,
+ qDebug() << state());
+ }
+ setState(InferiorStopped);
+
const QByteArray &msg = data.findChild("consolestreamoutput").data();
if (msg.contains("Stopped due to shared library event") || reason.isEmpty()) {
if (theDebuggerBoolSetting(SelectedPluginBreakpoints)) {
// MAC yields sometimes:
// >3661*stopped,time={wallclock="0.00658",user="0.00142",
// system="0.00136",start="1218810678.805432",end="1218810678.812011"}
- setState(InferiorStopped);
showStatusMessage(tr("Run to Function finished. Stopped."));
StackFrame f = parseStackFrame(data.findChild("frame"), 0);
gotoLocation(f, true);
GdbMi frameData = data.findChild("frame");
if (frameData.findChild("func").data() == "_start"
&& frameData.findChild("from").data() == "/lib/ld-linux.so.2") {
+ setState(InferiorRunningRequested);
postCommand(_("-exec-continue"), RunRequest, CB(handleExecContinue));
return;
}
void GdbEngine::handleStop2(const GdbMi &data)
{
- if (state() == InferiorRunning) {
- // Stop triggered by a breakpoint or otherwise not directly
- // initiated by the user.
- setState(InferiorStopping);
- }
- setState(InferiorStopped);
- showStatusMessage(tr("Stopped."), 5000);
-
// Sometimes we get some interesting extra information. Grab it.
GdbMi frame = data.findChild("frame");
GdbMi shortName = frame.findChild("file");
void RemoteGdbAdapter::handleTargetRemote(const GdbResponse &record)
{
- QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (record.resultClass == GdbResultDone) {
+ QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
// gdb server will stop the remote application itself.
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(msgAttachedToStoppedInferior());
- setState(InferiorStopped);
m_engine->continueInferior();
} else {
// 16^error,msg="hd:5555: Connection timed out."