forked from qt-creator/qt-creator
Debugger: Remove messaging indirection in DebuggerRunControl
The base functionality is good enough. Change-Id: Ie39398828733245e0e74ca9a2941c069116014f0 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -166,7 +166,7 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig,
|
||||
connect(m_runner, &AndroidRunner::remoteProcessFinished,
|
||||
[this](const QString &errorMsg) {
|
||||
QTC_ASSERT(m_runControl, return);
|
||||
m_runControl->showMessage(errorMsg, AppStuff);
|
||||
m_runControl->appendMessage(errorMsg, Utils::DebugFormat);
|
||||
});
|
||||
|
||||
connect(m_runner, &AndroidRunner::remoteErrorOutput,
|
||||
|
||||
@@ -315,7 +315,6 @@ public:
|
||||
bool m_isStateDebugging;
|
||||
|
||||
Utils::FileInProjectFinder m_fileFinder;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -495,10 +494,21 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c
|
||||
consoleManager->printToConsolePane(QmlJS::ConsoleItem::UndefinedType, msg);
|
||||
|
||||
debuggerCore()->showMessage(msg, channel, timeout);
|
||||
if (d->m_runControl)
|
||||
d->m_runControl->showMessage(msg, channel);
|
||||
else
|
||||
if (d->m_runControl) {
|
||||
switch (channel) {
|
||||
case AppOutput:
|
||||
d->m_runControl->appendMessage(msg, Utils::StdOutFormatSameLine);
|
||||
break;
|
||||
case AppError:
|
||||
d->m_runControl->appendMessage(msg, Utils::StdErrFormatSameLine);
|
||||
break;
|
||||
case AppStuff:
|
||||
d->m_runControl->appendMessage(msg, Utils::DebugFormat);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
qWarning("Warning: %s (no active run control)", qPrintable(msg));
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef DEBUGGERRUNCONTROLFACTORY_H
|
||||
#define DEBUGGERRUNCONTROLFACTORY_H
|
||||
|
||||
#include "debuggerconstants.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
@@ -192,21 +192,6 @@ void DebuggerRunControl::handleFinished()
|
||||
debuggerCore()->runControlFinished(m_engine);
|
||||
}
|
||||
|
||||
void DebuggerRunControl::showMessage(const QString &msg, int channel)
|
||||
{
|
||||
switch (channel) {
|
||||
case AppOutput:
|
||||
appendMessage(msg, StdOutFormatSameLine);
|
||||
break;
|
||||
case AppError:
|
||||
appendMessage(msg, StdErrFormatSameLine);
|
||||
break;
|
||||
case AppStuff:
|
||||
appendMessage(msg, DebugFormat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const
|
||||
{
|
||||
QTC_ASSERT(isRunning(), return true);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#define DEBUGGERRUNNER_H
|
||||
|
||||
#include "debugger_global.h"
|
||||
#include "debuggerconstants.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
@@ -61,8 +60,6 @@ public:
|
||||
void debuggingFinished();
|
||||
DebuggerEngine *engine();
|
||||
|
||||
void showMessage(const QString &msg, int channel);
|
||||
|
||||
signals:
|
||||
void engineRequestSetup();
|
||||
|
||||
|
||||
@@ -230,9 +230,9 @@ void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
|
||||
{
|
||||
if (m_runControl) {
|
||||
if (!cleanEnd)
|
||||
m_runControl->showMessage(tr("Run ended with error."), AppStuff);
|
||||
m_runControl->appendMessage(tr("Run ended with error."), Utils::DebugFormat);
|
||||
else
|
||||
m_runControl->showMessage(tr("Run ended."), AppStuff);
|
||||
m_runControl->appendMessage(tr("Run ended."), Utils::DebugFormat);
|
||||
m_runControl->engine()->abortDebugger();
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ void IosDebugSupport::handleRemoteOutput(const QString &output)
|
||||
if (m_runControl->engine())
|
||||
m_runControl->engine()->showMessage(output, AppOutput);
|
||||
else
|
||||
m_runControl->showMessage(output, AppOutput);
|
||||
m_runControl->appendMessage(output, Utils::StdOutFormatSameLine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ void IosDebugSupport::handleRemoteErrorOutput(const QString &output)
|
||||
if (m_runControl->engine())
|
||||
m_runControl->engine()->showMessage(output, AppError);
|
||||
else
|
||||
m_runControl->showMessage(output, AppError);
|
||||
m_runControl->appendMessage(output, Utils::StdErrFormatSameLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user