Commit 0b5591ae authored by hjk's avatar hjk

debugger move DebuggerStartParameters into file of its own

parent 2266c8cd
......@@ -30,6 +30,7 @@ HEADERS += breakhandler.h \
debuggermainwindow.h \
debuggerplugin.h \
debuggerrunner.h \
debuggerstartparameters.h \
debuggerstreamops.h \
debuggerstringutils.h \
debuggertooltip.h \
......
......@@ -32,6 +32,7 @@
**************************************************************************/
#include "debuggerdialogs.h"
#include "debuggerconstants.h"
#include "cdb2/cdbengine2.h"
......
......@@ -95,22 +95,9 @@ using namespace TextEditor;
namespace Debugger {
DebuggerStartParameters::DebuggerStartParameters() :
isSnapshot(false),
attachPID(-1),
useTerminal(false),
qmlServerAddress("127.0.0.1"),
qmlServerPort(0),
useServerStartScript(false),
connParams(SshConnectionParameters::NoProxy),
toolChainType(ToolChain_UNKNOWN),
startMode(NoStartMode),
executableUid(0)
{}
QString DebuggerStartParameters::toolChainName() const
QString toolChainName(const DebuggerStartParameters &sp)
{
return ToolChain::toolChainName(ProjectExplorer::ToolChainType(toolChainType));
return ToolChain::toolChainName(ProjectExplorer::ToolChainType(sp.toolChainType));
}
QDebug operator<<(QDebug d, DebuggerState state)
......@@ -138,37 +125,6 @@ QDebug operator<<(QDebug str, const DebuggerStartParameters &sp)
return str;
}
const char *DebuggerEngine::stateName(int s)
{
# define SN(x) case x: return #x;
switch (s) {
SN(DebuggerNotReady)
SN(EngineSetupRequested)
SN(EngineSetupOk)
SN(EngineSetupFailed)
SN(EngineRunFailed)
SN(InferiorSetupRequested)
SN(InferiorSetupFailed)
SN(EngineRunRequested)
SN(InferiorRunRequested)
SN(InferiorRunOk)
SN(InferiorRunFailed)
SN(InferiorUnrunnable)
SN(InferiorStopRequested)
SN(InferiorStopOk)
SN(InferiorStopFailed)
SN(InferiorShutdownRequested)
SN(InferiorShutdownOk)
SN(InferiorShutdownFailed)
SN(EngineShutdownRequested)
SN(EngineShutdownOk)
SN(EngineShutdownFailed)
SN(DebuggerFinished)
}
return "<unknown>";
# undef SN
}
///////////////////////////////////////////////////////////////////////
//
......@@ -336,6 +292,37 @@ DebuggerEngine::~DebuggerEngine()
delete d;
}
const char *DebuggerEngine::stateName(int s)
{
# define SN(x) case x: return #x;
switch (s) {
SN(DebuggerNotReady)
SN(EngineSetupRequested)
SN(EngineSetupOk)
SN(EngineSetupFailed)
SN(EngineRunFailed)
SN(InferiorSetupRequested)
SN(InferiorSetupFailed)
SN(EngineRunRequested)
SN(InferiorRunRequested)
SN(InferiorRunOk)
SN(InferiorRunFailed)
SN(InferiorUnrunnable)
SN(InferiorStopRequested)
SN(InferiorStopOk)
SN(InferiorStopFailed)
SN(InferiorShutdownRequested)
SN(InferiorShutdownOk)
SN(InferiorShutdownFailed)
SN(EngineShutdownRequested)
SN(EngineShutdownOk)
SN(EngineShutdownFailed)
SN(DebuggerFinished)
}
return "<unknown>";
# undef SN
}
void DebuggerEngine::showStatusMessage(const QString &msg, int timeout) const
{
showMessage(msg, StatusBar, timeout);
......
......@@ -36,12 +36,12 @@
#include "debugger_global.h"
#include "debuggerconstants.h"
#include "debuggerstartparameters.h"
#include "moduleshandler.h" // For 'Symbols'
#include "breakpoint.h" // For 'BreakpointId'
#include "stackframe.h"
#include <coreplugin/ssh/sshconnection.h>
#include <utils/environment.h>
#include <QtCore/QObject>
......@@ -66,59 +66,6 @@ namespace Debugger {
class DebuggerEnginePrivate;
class DebuggerRunControl;
class DEBUGGER_EXPORT DebuggerStartParameters
{
public:
DebuggerStartParameters();
QString toolChainName() const;
QString executable;
QString displayName;
QString coreFile;
bool isSnapshot; // set if created internally
QString processArgs;
Utils::Environment environment;
QString workingDirectory;
qint64 attachPID;
bool useTerminal;
// Used by AttachCrashedExternal.
QString crashParameter;
// Used by Qml debugging.
QString qmlServerAddress;
quint16 qmlServerPort;
QString projectBuildDir;
QString projectDir;
// Used by combined cpp+qml debugging.
DebuggerEngineType cppEngineType;
// Used by remote debugging.
QString remoteChannel;
QString remoteArchitecture;
QString gnuTarget;
QString symbolFileName;
bool useServerStartScript;
QString serverStartScript;
QString sysRoot;
QByteArray remoteDumperLib;
QByteArray remoteSourcesDir;
QString remoteMountPoint;
QString localMountDir;
Core::SshConnectionParameters connParams;
QString debuggerCommand;
int toolChainType;
QString qtInstallPath;
QString dumperLibrary;
QStringList dumperLibraryLocations;
DebuggerStartMode startMode;
// For Symbian debugging.
quint32 executableUid;
};
DEBUGGER_EXPORT QDebug operator<<(QDebug str, const DebuggerStartParameters &);
DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
......@@ -181,6 +128,7 @@ private:
quint64 m_address;
};
QString toolChainName(const DebuggerStartParameters &sp);
} // namespace Internal
......
......@@ -1339,6 +1339,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
{
qRegisterMetaType<WatchData>("WatchData");
qRegisterMetaType<ContextData>("ContextData");
qRegisterMetaType<DebuggerStartParameters>("DebuggerStartParameters");
QTC_ASSERT(!theDebuggerCore, /**/);
theDebuggerCore = this;
......@@ -2500,7 +2501,7 @@ void DebuggerPluginPrivate::runControlStarted(DebuggerEngine *engine)
activateDebugMode();
const QString message = tr("Starting debugger '%1' for tool chain '%2'...")
.arg(engine->objectName())
.arg(engine->startParameters().toolChainName());
.arg(toolChainName(engine->startParameters()));
showMessage(message, StatusBar);
showMessage(m_debuggerSettings->dump(), LogDebug);
m_snapshotHandler->appendSnapshot(engine);
......
......@@ -373,7 +373,7 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
debuggingFinished();
// Create Message box with possibility to go to settings.
const QString msg = tr("Cannot debug '%1' (tool chain: '%2'): %3")
.arg(sp.executable, sp.toolChainName(), d->m_errorMessage);
.arg(sp.executable, toolChainName(sp), d->m_errorMessage);
Core::ICore::instance()->showWarningWithOptions(tr("Warning"),
msg, QString(), QLatin1String(Constants::DEBUGGER_SETTINGS_CATEGORY),
d->m_settingsIdHint);
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_DEBUGGERSTARTPARAMETERS_H
#define DEBUGGER_DEBUGGERSTARTPARAMETERS_H
#include "debugger_global.h"
#include <coreplugin/ssh/sshconnection.h>
#include <utils/environment.h>
#include <projectexplorer/toolchaintype.h>
#include <QtCore/QMetaType>
namespace Debugger {
// Note: This is part of the "soft interface" of the debugger plugin.
// Do not add anything that needs implementation in a .cpp file.
class DEBUGGER_EXPORT DebuggerStartParameters
{
public:
DebuggerStartParameters()
: isSnapshot(false),
attachPID(-1),
useTerminal(false),
qmlServerAddress(QLatin1String("127.0.0.1")),
qmlServerPort(0),
useServerStartScript(false),
connParams(Core::SshConnectionParameters::NoProxy),
toolChainType(ProjectExplorer::ToolChain_UNKNOWN),
startMode(NoStartMode),
executableUid(0)
{}
QString executable;
QString displayName;
QString coreFile;
bool isSnapshot; // Set if created internally.
QString processArgs;
Utils::Environment environment;
QString workingDirectory;
qint64 attachPID;
bool useTerminal;
// Used by AttachCrashedExternal.
QString crashParameter;
// Used by Qml debugging.
QString qmlServerAddress;
quint16 qmlServerPort;
QString projectBuildDir;
QString projectDir;
// Used by combined cpp+qml debugging.
DebuggerEngineType cppEngineType;
// Used by remote debugging.
QString remoteChannel;
QString remoteArchitecture;
QString gnuTarget;
QString symbolFileName;
bool useServerStartScript;
QString serverStartScript;
QString sysRoot;
QByteArray remoteDumperLib;
QByteArray remoteSourcesDir;
QString remoteMountPoint;
QString localMountDir;
Core::SshConnectionParameters connParams;
QString debuggerCommand;
int toolChainType;
QString qtInstallPath;
QString dumperLibrary;
QStringList dumperLibraryLocations;
DebuggerStartMode startMode;
// For Symbian debugging.
quint32 executableUid;
};
} // namespace Debugger
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
#endif // DEBUGGER_DEBUGGERSTARTPARAMETERS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment