debugger: refactoring of output channeling

This commit is contained in:
hjk
2010-06-14 18:19:02 +02:00
parent 254a51bf5a
commit 9f7e9dc0ae
27 changed files with 225 additions and 234 deletions

View File

@@ -128,7 +128,7 @@ void ScriptAgent::exceptionCatch(qint64 scriptId, const QScriptValue & exception
const QString msg = QString::fromLatin1("An exception was caught on %1: '%2'").
arg(scriptId).arg(exception.toString());
SDEBUG(msg);
q->showDebuggerOutput(msg, LogMisc);
q->showMessage(msg, LogMisc);
}
void ScriptAgent::exceptionThrow(qint64 scriptId, const QScriptValue &exception,
@@ -140,13 +140,13 @@ void ScriptAgent::exceptionThrow(qint64 scriptId, const QScriptValue &exception,
const QString msg = QString::fromLatin1("An exception occurred on %1: '%2'").
arg(scriptId).arg(exception.toString());
SDEBUG(msg);
q->showDebuggerOutput(msg, LogMisc);
q->showMessage(msg, LogMisc);
}
void ScriptAgent::functionEntry(qint64 scriptId)
{
Q_UNUSED(scriptId)
q->showDebuggerOutput(QString::fromLatin1("Function entry occurred on %1").arg(scriptId), LogMisc);
q->showMessage(QString::fromLatin1("Function entry occurred on %1").arg(scriptId), LogMisc);
q->checkForBreakCondition(true);
}
@@ -156,7 +156,7 @@ void ScriptAgent::functionExit(qint64 scriptId, const QScriptValue &returnValue)
Q_UNUSED(returnValue)
const QString msg = QString::fromLatin1("Function exit occurred on %1: '%2'").arg(scriptId).arg(returnValue.toString());
SDEBUG(msg);
q->showDebuggerOutput(msg, LogMisc);
q->showMessage(msg, LogMisc);
}
void ScriptAgent::positionChange(qint64 scriptId, int lineNumber, int columnNumber)
@@ -175,7 +175,7 @@ void ScriptAgent::scriptLoad(qint64 scriptId, const QString &program,
Q_UNUSED(program)
Q_UNUSED(fileName)
Q_UNUSED(baseLineNumber)
q->showDebuggerOutput(QString::fromLatin1("Loaded: %1 id: %2")
q->showMessage(QString::fromLatin1("Loaded: %1 id: %2")
.arg(fileName).arg(scriptId), LogMisc);
}
@@ -252,7 +252,7 @@ void ScriptEngine::startDebugger()
m_scriptFileName = QFileInfo(runControl()->sp().executable).absoluteFilePath();
QFile scriptFile(m_scriptFileName);
if (!scriptFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
showDebuggerOutput(QString::fromLatin1("Cannot open %1: %2").
showMessage(QString::fromLatin1("Cannot open %1: %2").
arg(m_scriptFileName, scriptFile.errorString()), LogError);
emit startFailed();
return;
@@ -263,7 +263,7 @@ void ScriptEngine::startDebugger()
attemptBreakpointSynchronization();
setState(InferiorRunningRequested);
showStatusMessage(tr("Running requested..."), 5000);
showDebuggerOutput(QLatin1String("Running: ") + m_scriptFileName, LogMisc);
showMessage(QLatin1String("Running: ") + m_scriptFileName, LogMisc);
QTimer::singleShot(0, this, SLOT(runInferior()));
emit startSuccessful();
}
@@ -341,7 +341,7 @@ void ScriptEngine::runInferior()
msg = QString::fromLatin1("Evaluation returns '%1'")
.arg(result.toString());
}
showDebuggerOutput(msg, LogMisc);
showMessage(msg, LogMisc);
exitDebugger();
}