Commit 244cdb78 authored by hjk's avatar hjk
Browse files

Debugger: Split off runtime-only items from DebuggerStartParameters



Right now, DebuggerStartParameter is part of the debugger plugin
external interface. Better not make it fatter than necessary.

Change-Id: I3b9205089f971dd314ccba1335b5ca2d4d9fe7c6
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 28d2b161
......@@ -187,7 +187,7 @@ Q_DECLARE_METATYPE(Debugger::Internal::MemoryChangeCookie)
namespace Debugger {
namespace Internal {
static inline bool isCreatorConsole(const DebuggerStartParameters &sp)
static inline bool isCreatorConsole(const DebuggerRunParameters &sp)
{
return !boolSetting(UseCdbConsole) && sp.useTerminal
&& (sp.startMode == StartInternal || sp.startMode == StartExternal);
......@@ -267,7 +267,7 @@ static inline bool validMode(DebuggerStartMode sm)
}
// Accessed by RunControlFactory
DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *errorMessage)
DebuggerEngine *createCdbEngine(const DebuggerRunParameters &sp, QString *errorMessage)
{
if (HostOsInfo::isWindowsHost()) {
if (validMode(sp.startMode))
......@@ -289,7 +289,7 @@ void addCdbOptionPages(QList<Core::IOptionsPage *> *opts)
#define QT_CREATOR_CDB_EXT "qtcreatorcdbext"
CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
CdbEngine::CdbEngine(const DebuggerRunParameters &sp) :
DebuggerEngine(sp),
m_tokenPrefix("<token>"),
m_effectiveStartMode(NoStartMode),
......@@ -472,7 +472,7 @@ int CdbEngine::elapsedLogTime() const
}
// Start the console stub with the sub process. Continue in consoleStubProcessStarted.
bool CdbEngine::startConsole(const DebuggerStartParameters &sp, QString *errorMessage)
bool CdbEngine::startConsole(const DebuggerRunParameters &sp, QString *errorMessage)
{
if (debug)
qDebug("startConsole %s", qPrintable(sp.executable));
......@@ -513,7 +513,7 @@ void CdbEngine::consoleStubProcessStarted()
if (debug)
qDebug("consoleStubProcessStarted() PID=%lld", m_consoleStub->applicationPID());
// Attach to console process.
DebuggerStartParameters attachParameters = startParameters();
DebuggerRunParameters attachParameters = runParameters();
attachParameters.executable.clear();
attachParameters.processArgs.clear();
attachParameters.attachPID = m_consoleStub->applicationPID();
......@@ -560,12 +560,12 @@ void CdbEngine::setupEngine()
// CDB in theory has a command line option '-2' that launches a
// console, too, but that immediately closes when the debuggee quits.
// Use the Creator stub instead.
const DebuggerStartParameters &sp = startParameters();
const bool launchConsole = isCreatorConsole(sp);
m_effectiveStartMode = launchConsole ? AttachExternal : sp.startMode;
const DebuggerRunParameters &rp = runParameters();
const bool launchConsole = isCreatorConsole(rp);
m_effectiveStartMode = launchConsole ? AttachExternal : rp.startMode;
const bool ok = launchConsole ?
startConsole(startParameters(), &errorMessage) :
launchCDB(startParameters(), &errorMessage);
startConsole(runParameters(), &errorMessage) :
launchCDB(runParameters(), &errorMessage);
if (debug)
qDebug("<setupEngine ok=%d", ok);
if (!ok) {
......@@ -593,7 +593,7 @@ void CdbEngine::setupEngine()
wh->addTypeFormats("QImage *", imageFormats);
}
bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessage)
bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage)
{
if (debug)
qDebug("launchCDB startMode=%d", sp.startMode);
......@@ -662,7 +662,7 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
if (sp.startMode == AttachCrashedExternal) {
arguments << QLatin1String("-e") << sp.crashParameter << QLatin1String("-g");
} else {
if (isCreatorConsole(startParameters()))
if (isCreatorConsole(runParameters()))
arguments << QLatin1String("-pr") << QLatin1String("-pb");
}
break;
......@@ -725,13 +725,13 @@ void CdbEngine::setupInferior()
{
if (debug)
qDebug("setupInferior");
const DebuggerStartParameters &sp = startParameters();
if (!sp.commandsAfterConnect.isEmpty())
postCommand(sp.commandsAfterConnect, 0);
const DebuggerRunParameters &rp = runParameters();
if (!rp.commandsAfterConnect.isEmpty())
postCommand(rp.commandsAfterConnect, 0);
// QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
// (attemptBreakpointSynchronization() will be directly called then)
attemptBreakpointSynchronization();
if (sp.breakOnMain) {
if (rp.breakOnMain) {
const BreakpointParameters bp(BreakpointAtMain);
postBuiltinCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings,
BreakpointModelId(quint16(-1)), true), 0,
......@@ -790,7 +790,7 @@ void CdbEngine::runEngine()
// Break functions: each function must be fully qualified,
// else the debugger will slow down considerably.
if (boolSetting(CdbBreakOnCrtDbgReport)) {
const QByteArray module = msvcRunTime(startParameters().toolChainAbi.osFlavor());
const QByteArray module = msvcRunTime(runParameters().toolChainAbi.osFlavor());
const QByteArray debugModule = module + 'D';
const QByteArray wideFunc = QByteArray(CdbOptionsPage::crtDbgReport).append('W');
postBuiltinCommand(breakAtFunctionCommand(CdbOptionsPage::crtDbgReport, module), 0,
......@@ -814,7 +814,7 @@ void CdbEngine::runEngine()
postBuiltinCommand("bm /( Qt5Cored!QMessageLogger::fatal", 0,
CB(handleBreakInsert));
}
if (startParameters().startMode == AttachCore) {
if (runParameters().startMode == AttachCore) {
QTC_ASSERT(!m_coreStopReason.isNull(), return; );
notifyEngineRunOkAndInferiorUnrunnable();
processStop(*m_coreStopReason, false);
......@@ -843,7 +843,7 @@ void CdbEngine::shutdownInferior()
}
if (m_accessible) { // except console.
if (startParameters().startMode == AttachExternal || startParameters().startMode == AttachCrashedExternal)
if (runParameters().startMode == AttachExternal || runParameters().startMode == AttachCrashedExternal)
detachDebugger();
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorShutdownOk")
notifyInferiorShutdownOk();
......@@ -892,7 +892,7 @@ void CdbEngine::shutdownEngine()
// Go for kill if there are commands pending.
if (m_accessible && !commandsPending()) {
// detach (except console): Wait for debugger to finish.
if (startParameters().startMode == AttachExternal || startParameters().startMode == AttachCrashedExternal)
if (runParameters().startMode == AttachExternal || runParameters().startMode == AttachCrashedExternal)
detachDebugger();
// Remote requires a bit more force to quit.
if (m_effectiveStartMode == AttachToRemoteServer) {
......@@ -1130,13 +1130,13 @@ void CdbEngine::doInterruptInferior(SpecialStopMode sm)
showMessage(QString::fromLatin1("Interrupting process %1...").arg(inferiorPid()), LogMisc);
QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return;);
m_signalOperation = startParameters().device->signalOperation();
m_signalOperation = runParameters().device->signalOperation();
m_specialStopMode = sm;
QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed(); return;);
connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished,
this, &CdbEngine::handleDoInterruptInferior);
m_signalOperation->setDebuggerCommand(startParameters().debuggerCommand);
m_signalOperation->setDebuggerCommand(runParameters().debuggerCommand);
m_signalOperation->interruptProcess(inferiorPid());
}
......@@ -1199,7 +1199,7 @@ void CdbEngine::jumpToAddress(quint64 address)
QByteArray registerCmd;
ByteArrayInputStream str(registerCmd);
// PC-register depending on 64/32bit.
str << "r " << (startParameters().toolChainAbi.wordWidth() == 64 ? "rip" : "eip") << '=';
str << "r " << (runParameters().toolChainAbi.wordWidth() == 64 ? "rip" : "eip") << '=';
str.setHexPrefix(true);
str.setIntegerBase(16);
str << address;
......@@ -1755,7 +1755,7 @@ void CdbEngine::handlePid(const CdbResponse &response)
// Fails for core dumps.
if (response.success)
notifyInferiorPid(response.extensionReply.toULongLong());
if (response.success || startParameters().startMode == AttachCore) {
if (response.success || runParameters().startMode == AttachCore) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorSetupOk")
notifyInferiorSetupOk();
} else {
......@@ -2083,7 +2083,7 @@ void CdbEngine::handleSessionIdle(const QByteArray &messageBA)
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupOk")
notifyEngineSetupOk();
// Store stop reason to be handled in runEngine().
if (startParameters().startMode == AttachCore) {
if (runParameters().startMode == AttachCore) {
m_coreStopReason.reset(new GdbMi);
m_coreStopReason->fromString(messageBA);
}
......@@ -2117,7 +2117,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
}
// Notify about state and send off command sequence to get stack, etc.
if (stopFlags & StopNotifyStop) {
if (startParameters().startMode != AttachCore) {
if (runParameters().startMode != AttachCore) {
if (state() == InferiorStopRequested) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorStopOk")
notifyInferiorStopOk();
......@@ -3003,7 +3003,7 @@ void CdbEngine::handleAdditionalQmlStack(const CdbResponse &response)
break;
}
for (int i = 0; i < qmlFrameCount; ++i)
qmlFrames[i].fixQmlFrame(startParameters());
qmlFrames[i].fixQmlFrame(runParameters());
stackHandler()->prependFrames(qmlFrames);
} while (false);
if (!errorMessage.isEmpty())
......@@ -3012,9 +3012,9 @@ void CdbEngine::handleAdditionalQmlStack(const CdbResponse &response)
void CdbEngine::mergeStartParametersSourcePathMap()
{
const DebuggerStartParameters &sp = startParameters();
QMap<QString, QString>::const_iterator end = sp.sourcePathMap.end();
for (QMap<QString, QString>::const_iterator it = sp.sourcePathMap.begin(); it != end; ++it) {
const DebuggerRunParameters &rp = runParameters();
QMap<QString, QString>::const_iterator end = rp.sourcePathMap.end();
for (QMap<QString, QString>::const_iterator it = rp.sourcePathMap.begin(); it != end; ++it) {
SourcePathMapping spm(QDir::toNativeSeparators(it.key()), QDir::toNativeSeparators(it.value()));
if (!m_sourcePathMappings.contains(spm))
m_sourcePathMappings.push_back(spm);
......
......@@ -73,7 +73,7 @@ public:
typedef QSharedPointer<CdbCommand> CdbCommandPtr;
typedef std::function<void(const CdbResponse &)> CommandHandler;
CdbEngine(const DebuggerStartParameters &sp);
CdbEngine(const DebuggerRunParameters &sp);
~CdbEngine();
// Factory function that returns 0 if the debug engine library cannot be found.
......@@ -187,7 +187,7 @@ private:
};
bool startConsole(const DebuggerStartParameters &sp, QString *errorMessage);
bool startConsole(const DebuggerRunParameters &sp, QString *errorMessage);
void init();
unsigned examineStopReason(const GdbMi &stopReason, QString *message,
QString *exceptionBoxMessage,
......@@ -196,7 +196,7 @@ private:
bool commandsPending() const;
void handleExtensionMessage(char t, int token, const QByteArray &what, const QByteArray &message);
bool doSetupEngine(QString *errorMessage);
bool launchCDB(const DebuggerStartParameters &sp, QString *errorMessage);
bool launchCDB(const DebuggerRunParameters &sp, QString *errorMessage);
void handleSessionAccessible(unsigned long cdbExState);
void handleSessionInaccessible(unsigned long cdbExState);
void handleSessionIdle(const QByteArray &message);
......
......@@ -358,9 +358,9 @@ void StartApplicationDialog::updateState()
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(okEnabled);
}
bool StartApplicationDialog::run(QWidget *parent, DebuggerStartParameters *sp)
bool StartApplicationDialog::run(QWidget *parent, DebuggerRunParameters *rp)
{
const bool attachRemote = sp->startMode == AttachToRemoteServer;
const bool attachRemote = rp->startMode == AttachToRemoteServer;
const QString settingsGroup = QLatin1String("DebugMode");
const QString arrayName = QLatin1String("StartApplication");
......@@ -411,29 +411,29 @@ bool StartApplicationDialog::run(QWidget *parent, DebuggerStartParameters *sp)
Kit *kit = dialog.d->kitChooser->currentKit();
QTC_ASSERT(kit, return false);
bool res = DebuggerRunControlFactory::fillParametersFromKit(sp, kit);
bool res = fillParametersFromKit(rp, kit);
QTC_ASSERT(res, return false);
sp->executable = newParameters.localExecutable;
rp->executable = newParameters.localExecutable;
const QString inputAddress = dialog.d->serverAddressEdit->text();
if (!inputAddress.isEmpty())
sp->remoteChannel = inputAddress;
rp->remoteChannel = inputAddress;
else
sp->remoteChannel = sp->connParams.host;
sp->remoteChannel += QLatin1Char(':') + QString::number(newParameters.serverPort);
sp->displayName = newParameters.displayName();
sp->workingDirectory = newParameters.workingDirectory;
sp->useTerminal = newParameters.runInTerminal;
rp->remoteChannel = rp->connParams.host;
rp->remoteChannel += QLatin1Char(':') + QString::number(newParameters.serverPort);
rp->displayName = newParameters.displayName();
rp->workingDirectory = newParameters.workingDirectory;
rp->useTerminal = newParameters.runInTerminal;
if (!newParameters.processArgs.isEmpty())
sp->processArgs = newParameters.processArgs;
sp->breakOnMain = newParameters.breakAtMain;
sp->serverStartScript = newParameters.serverStartScript;
sp->debugInfoLocation = newParameters.debugInfoLocation;
rp->processArgs = newParameters.processArgs;
rp->breakOnMain = newParameters.breakAtMain;
rp->serverStartScript = newParameters.serverStartScript;
rp->debugInfoLocation = newParameters.debugInfoLocation;
IDevice::ConstPtr dev = DeviceKitInformation::device(kit);
bool isLocal = !dev || (dev->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE);
if (!attachRemote)
sp->startMode = isLocal ? StartExternal : StartRemoteProcess;
rp->startMode = isLocal ? StartExternal : StartRemoteProcess;
return true;
}
......
......@@ -50,13 +50,11 @@ namespace Core { class Id; }
namespace ProjectExplorer { class Kit; }
namespace Debugger {
class DebuggerStartParameters;
namespace Internal {
class AttachCoreDialogPrivate;
class AttachToQmlPortDialogPrivate;
class ProcessListFilterModel;
class DebuggerRunParameters;
class StartApplicationParameters;
class StartApplicationDialogPrivate;
class StartRemoteEngineDialogPrivate;
......@@ -87,7 +85,7 @@ public:
explicit StartApplicationDialog(QWidget *parent);
~StartApplicationDialog();
static bool run(QWidget *parent, DebuggerStartParameters *sp);
static bool run(QWidget *parent, DebuggerRunParameters *rp);
private slots:
void historyIndexChanged(int);
......
......@@ -94,7 +94,7 @@ enum { debug = 0 };
///////////////////////////////////////////////////////////////////////
//
// DebuggerStartParameters
// DebuggerRunParameters
//
///////////////////////////////////////////////////////////////////////
......@@ -109,7 +109,7 @@ QDebug operator<<(QDebug d, DebuggerState state)
return d << DebuggerEngine::stateName(state);
}
QDebug operator<<(QDebug str, const DebuggerStartParameters &sp)
QDebug operator<<(QDebug str, const DebuggerRunParameters &sp)
{
QDebug nospace = str.nospace();
nospace << "executable=" << sp.executable
......@@ -166,11 +166,11 @@ class DebuggerEnginePrivate : public QObject
Q_OBJECT
public:
DebuggerEnginePrivate(DebuggerEngine *engine, const DebuggerStartParameters &sp)
DebuggerEnginePrivate(DebuggerEngine *engine, const DebuggerRunParameters &sp)
: m_engine(engine),
m_masterEngine(0),
m_runControl(0),
m_startParameters(sp),
m_runParameters(sp),
m_state(DebuggerNotReady),
m_lastGoodState(DebuggerNotReady),
m_targetState(DebuggerNotReady),
......@@ -195,7 +195,7 @@ public:
Utils::globalMacroExpander()->registerFileVariables(PrefixDebugExecutable,
tr("Debugged executable"),
[this]() { return m_startParameters.executable; });
[this]() { return m_runParameters.executable; });
}
public slots:
......@@ -298,7 +298,7 @@ public:
DebuggerEngine *m_masterEngine; // Not owned
DebuggerRunControl *m_runControl; // Not owned.
DebuggerStartParameters m_startParameters;
DebuggerRunParameters m_runParameters;
// The current state.
DebuggerState m_state;
......@@ -342,7 +342,7 @@ public:
//
//////////////////////////////////////////////////////////////////////
DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters)
DebuggerEngine::DebuggerEngine(const DebuggerRunParameters &startParameters)
: d(new DebuggerEnginePrivate(this, startParameters))
{}
......@@ -543,13 +543,13 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_runControl = runControl;
d->m_inferiorPid = d->m_startParameters.attachPID > 0
? d->m_startParameters.attachPID : 0;
d->m_inferiorPid = d->m_runParameters.attachPID > 0
? d->m_runParameters.attachPID : 0;
if (d->m_inferiorPid)
d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid));
if (!d->m_startParameters.environment.size())
d->m_startParameters.environment = Utils::Environment();
if (!d->m_runParameters.environment.size())
d->m_runParameters.environment = Utils::Environment();
action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability));
......@@ -641,14 +641,14 @@ void DebuggerEngine::handleFinished()
watchHandler()->cleanup();
}
const DebuggerStartParameters &DebuggerEngine::startParameters() const
const DebuggerRunParameters &DebuggerEngine::runParameters() const
{
return d->m_startParameters;
return d->m_runParameters;
}
DebuggerStartParameters &DebuggerEngine::startParameters()
DebuggerRunParameters &DebuggerEngine::runParameters()
{
return d->m_startParameters;
return d->m_runParameters;
}
DebuggerState DebuggerEngine::state() const
......@@ -751,7 +751,7 @@ void DebuggerEnginePrivate::doSetupEngine()
{
m_engine->showMessage(_("CALL: SETUP ENGINE"));
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << m_engine << state());
m_engine->validateExecutable(&m_startParameters);
m_engine->validateExecutable(&m_runParameters);
m_engine->setupEngine();
}
......@@ -895,20 +895,20 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
d->setRemoteSetupState(RemoteSetupSucceeded);
if (result.gdbServerPort != InvalidPid) {
QString &rc = d->m_startParameters.remoteChannel;
QString &rc = d->m_runParameters.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.gdbServerPort));
}
} else if (result.inferiorPid != InvalidPid && startParameters().startMode == AttachExternal) {
} else if (result.inferiorPid != InvalidPid && runParameters().startMode == AttachExternal) {
// e.g. iOS Simulator
startParameters().attachPID = result.inferiorPid;
runParameters().attachPID = result.inferiorPid;
}
if (result.qmlServerPort != InvalidPort) {
d->m_startParameters.qmlServerPort = result.qmlServerPort;
d->m_startParameters.processArgs.replace(_("%qml_port%"), QString::number(result.qmlServerPort));
d->m_runParameters.qmlServerPort = result.qmlServerPort;
d->m_runParameters.processArgs.replace(_("%qml_port%"), QString::number(result.qmlServerPort));
}
} else {
......@@ -1308,11 +1308,11 @@ DebuggerEngine *DebuggerEngine::masterEngine() const
QString DebuggerEngine::toFileInProject(const QUrl &fileUrl)
{
// make sure file finder is properly initialized
const DebuggerStartParameters &sp = startParameters();
d->m_fileFinder.setProjectDirectory(sp.projectSourceDirectory);
d->m_fileFinder.setProjectFiles(sp.projectSourceFiles);
d->m_fileFinder.setAdditionalSearchDirectories(sp.additionalSearchDirectories);
d->m_fileFinder.setSysroot(sp.sysRoot);
const DebuggerRunParameters &rp = runParameters();
d->m_fileFinder.setProjectDirectory(rp.projectSourceDirectory);
d->m_fileFinder.setProjectFiles(rp.projectSourceFiles);
d->m_fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories);
d->m_fileFinder.setSysroot(rp.sysRoot);
return d->m_fileFinder.findFile(fileUrl);
}
......@@ -1362,9 +1362,9 @@ void DebuggerEngine::notifyInferiorPid(qint64 pid)
d->m_inferiorPid = pid;
if (pid) {
showMessage(tr("Taking notice of pid %1").arg(pid));
if (d->m_startParameters.startMode == StartInternal
|| d->m_startParameters.startMode == StartExternal
|| d->m_startParameters.startMode == AttachExternal)
if (d->m_runParameters.startMode == StartInternal
|| d->m_runParameters.startMode == StartExternal
|| d->m_runParameters.startMode == AttachExternal)
QTimer::singleShot(0, d, SLOT(raiseApplication()));
}
}
......@@ -1793,7 +1793,7 @@ void DebuggerEngine::setStateDebugging(bool on)
d->m_isStateDebugging = on;
}
void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
{
if (sp->skipExecutableValidation)
return;
......@@ -1980,6 +1980,17 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all)
emit stackFrameCompleted();
}
DebuggerRunParameters::DebuggerRunParameters()
: cppEngineType(NoEngineType),
isSnapshot(false),
testCase(0)
{}
void DebuggerRunParameters::operator=(const DebuggerStartParameters &sp)
{
DebuggerStartParameters::operator=(sp);
}
} // namespace Internal
} // namespace Debugger
......
......@@ -33,6 +33,9 @@
#include "debugger_global.h"
#include "debuggerconstants.h"
#include "debuggerstartparameters.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <QObject>
#include <QProcess>
......@@ -43,16 +46,13 @@ class QPoint;
class QAbstractItemModel;
QT_END_NAMESPACE
namespace TextEditor { class TextEditorWidget; }
namespace Core { class IOptionsPage; }
namespace Debugger {
class DebuggerRunControl;
class DebuggerStartParameters;
class RemoteSetupResult;
DEBUGGER_EXPORT QDebug operator<<(QDebug str, const DebuggerStartParameters &);
DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
namespace Internal {
......@@ -80,6 +80,34 @@ class MemoryViewSetupData;
class Terminal;
class ThreadId;
class DebuggerRunParameters : public DebuggerStartParameters
{
public:
DebuggerRunParameters();
void operator=(const DebuggerStartParameters &sp);
QString coreFile;
QString overrideStartScript; // Used in attach to core and remote debugging
QString startMessage; // First status message shown.
DebuggerEngineType cppEngineType;
QByteArray remoteSourcesDir;
QString remoteMountPoint;
QMap<QString, QString> sourcePathMap;
QString debugInfoLocation; // Gdb "set-debug-file-directory".
QStringList debugSourceLocation; // Gdb "directory"
QString serverStartScript;
QString localMountDir;
ProjectExplorer::IDevice::ConstPtr device;
bool isSnapshot; // Set if created internally.
// Used by AttachCrashedExternal.
QString crashParameter;
// For Debugger testing.
int testCase;
};
class Location
{
public:
......@@ -133,11 +161,11 @@ class DebuggerEngine : public QObject
Q_OBJECT
public:
explicit DebuggerEngine(const DebuggerStartParameters &sp);
explicit DebuggerEngine(const DebuggerRunParameters &sp);
virtual ~DebuggerEngine();
const DebuggerStartParameters &startParameters() const;
DebuggerStartParameters &startParameters();
const DebuggerRunParameters &runParameters() const;
DebuggerRunParameters &runParameters();
virtual bool setToolTipExpression(const Internal::DebuggerToolTipContext &);
......@@ -366,7 +394,7 @@ protected:
bool isStateDebugging() const;
void setStateDebugging(bool on);
static void validateExecutable(DebuggerStartParameters *sp);
static void validateExecutable(DebuggerRunParameters *sp);
virtual void setupSlaveInferior();
virtual void setupSlaveEngine();
......@@ -390,6 +418,16 @@ private:
DebuggerEnginePrivate *d;
};
DebuggerEngine *createEngine(DebuggerEngineType et, const DebuggerRunParameters &rp, QString *errorMessage);
bool fillParametersFromKit(DebuggerRunParameters *r, const ProjectExplorer::Kit *kit, QString *errorMessage = 0);
bool fillParametersFromLocalRunConfiguration(DebuggerRunParameters *rp,
const ProjectExplorer::RunConfiguration *runConfig, QString *errorMessage = 0);
DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp);
} // namespace Internal
} // namespace Debugger