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,
|
connect(m_runner, &AndroidRunner::remoteProcessFinished,
|
||||||
[this](const QString &errorMsg) {
|
[this](const QString &errorMsg) {
|
||||||
QTC_ASSERT(m_runControl, return);
|
QTC_ASSERT(m_runControl, return);
|
||||||
m_runControl->showMessage(errorMsg, AppStuff);
|
m_runControl->appendMessage(errorMsg, Utils::DebugFormat);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_runner, &AndroidRunner::remoteErrorOutput,
|
connect(m_runner, &AndroidRunner::remoteErrorOutput,
|
||||||
|
|||||||
@@ -315,7 +315,6 @@ public:
|
|||||||
bool m_isStateDebugging;
|
bool m_isStateDebugging;
|
||||||
|
|
||||||
Utils::FileInProjectFinder m_fileFinder;
|
Utils::FileInProjectFinder m_fileFinder;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -495,11 +494,22 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c
|
|||||||
consoleManager->printToConsolePane(QmlJS::ConsoleItem::UndefinedType, msg);
|
consoleManager->printToConsolePane(QmlJS::ConsoleItem::UndefinedType, msg);
|
||||||
|
|
||||||
debuggerCore()->showMessage(msg, channel, timeout);
|
debuggerCore()->showMessage(msg, channel, timeout);
|
||||||
if (d->m_runControl)
|
if (d->m_runControl) {
|
||||||
d->m_runControl->showMessage(msg, channel);
|
switch (channel) {
|
||||||
else
|
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));
|
qWarning("Warning: %s (no active run control)", qPrintable(msg));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
|
void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#ifndef DEBUGGERRUNCONTROLFACTORY_H
|
#ifndef DEBUGGERRUNCONTROLFACTORY_H
|
||||||
#define DEBUGGERRUNCONTROLFACTORY_H
|
#define DEBUGGERRUNCONTROLFACTORY_H
|
||||||
|
|
||||||
|
#include "debuggerconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|||||||
@@ -192,21 +192,6 @@ void DebuggerRunControl::handleFinished()
|
|||||||
debuggerCore()->runControlFinished(m_engine);
|
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
|
bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(isRunning(), return true);
|
QTC_ASSERT(isRunning(), return true);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#define DEBUGGERRUNNER_H
|
#define DEBUGGERRUNNER_H
|
||||||
|
|
||||||
#include "debugger_global.h"
|
#include "debugger_global.h"
|
||||||
#include "debuggerconstants.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
@@ -61,8 +60,6 @@ public:
|
|||||||
void debuggingFinished();
|
void debuggingFinished();
|
||||||
DebuggerEngine *engine();
|
DebuggerEngine *engine();
|
||||||
|
|
||||||
void showMessage(const QString &msg, int channel);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void engineRequestSetup();
|
void engineRequestSetup();
|
||||||
|
|
||||||
|
|||||||
@@ -230,9 +230,9 @@ void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
|
|||||||
{
|
{
|
||||||
if (m_runControl) {
|
if (m_runControl) {
|
||||||
if (!cleanEnd)
|
if (!cleanEnd)
|
||||||
m_runControl->showMessage(tr("Run ended with error."), AppStuff);
|
m_runControl->appendMessage(tr("Run ended with error."), Utils::DebugFormat);
|
||||||
else
|
else
|
||||||
m_runControl->showMessage(tr("Run ended."), AppStuff);
|
m_runControl->appendMessage(tr("Run ended."), Utils::DebugFormat);
|
||||||
m_runControl->engine()->abortDebugger();
|
m_runControl->engine()->abortDebugger();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ void IosDebugSupport::handleRemoteOutput(const QString &output)
|
|||||||
if (m_runControl->engine())
|
if (m_runControl->engine())
|
||||||
m_runControl->engine()->showMessage(output, AppOutput);
|
m_runControl->engine()->showMessage(output, AppOutput);
|
||||||
else
|
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())
|
if (m_runControl->engine())
|
||||||
m_runControl->engine()->showMessage(output, AppError);
|
m_runControl->engine()->showMessage(output, AppError);
|
||||||
else
|
else
|
||||||
m_runControl->showMessage(output, AppError);
|
m_runControl->appendMessage(output, Utils::StdErrFormatSameLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user