Files
qt-creator/src/plugins/debugger/debuggerrunner.h

146 lines
4.1 KiB
C
Raw Normal View History

/**************************************************************************
2008-12-02 12:01:29 +01:00
**
** This file is part of Qt Creator
**
2010-03-05 11:25:49 +01:00
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
2008-12-02 12:01:29 +01:00
**
** Contact: Nokia Corporation (qt-info@nokia.com)
2008-12-02 12:01:29 +01:00
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
2009-08-14 09:30:56 +02:00
** contact the sales department at http://qt.nokia.com/contact.
2008-12-02 12:01:29 +01:00
**
**************************************************************************/
2008-12-02 15:08:31 +01:00
2008-12-02 12:01:29 +01:00
#ifndef DEBUGGERRUNNER_H
#define DEBUGGERRUNNER_H
#include "debugger_global.h"
2010-06-11 17:03:15 +02:00
#include "debuggerconstants.h"
#include <coreplugin/ssh/sshconnection.h>
2008-12-02 12:01:29 +01:00
#include <projectexplorer/runconfiguration.h>
2010-06-11 17:03:15 +02:00
#include <QtCore/QStringList>
namespace ProjectExplorer {
class Environment;
}
2008-12-02 12:01:29 +01:00
namespace Debugger {
2010-06-11 17:03:15 +02:00
class DebuggerManager;
class DEBUGGER_EXPORT DebuggerStartParameters
{
public:
DebuggerStartParameters();
void clear();
QString executable;
QString displayName;
QString coreFile;
QStringList processArgs;
QStringList environment;
QString workingDirectory;
qint64 attachPID;
bool useTerminal;
QString crashParameter; // for AttachCrashedExternal
// for remote debugging
QString remoteChannel;
QString remoteArchitecture;
QString symbolFileName;
QString serverStartScript;
QString sysRoot;
QString debuggerCommand;
int toolChainType;
QByteArray remoteDumperLib;
QString qtInstallPath;
QString dumperLibrary;
QStringList dumperLibraryLocations;
Core::SshServerInfo sshserver;
DebuggerStartMode startMode;
};
//DEBUGGER_EXPORT QDebug operator<<(QDebug str, const DebuggerStartParameters &);
class DEBUGGER_EXPORT DebuggerRunControlFactory
: public ProjectExplorer::IRunControlFactory
2008-12-02 12:01:29 +01:00
{
Q_OBJECT
public:
explicit DebuggerRunControlFactory(DebuggerManager *manager);
2008-12-02 12:01:29 +01:00
// ProjectExplorer::IRunControlFactory
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
const QString &mode);
2008-12-02 12:01:29 +01:00
virtual QString displayName() const;
virtual QWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
2008-12-02 12:01:29 +01:00
// This is used by the "Non-Standard" scenarios, e.g. Attach to Core.
ProjectExplorer::RunControl *create(const DebuggerStartParameters &sp);
2008-12-02 12:01:29 +01:00
private:
DebuggerManager *m_manager;
};
// This is a job description
class DEBUGGER_EXPORT DebuggerRunControl
2009-09-11 08:55:16 +02:00
: public ProjectExplorer::RunControl
2008-12-02 12:01:29 +01:00
{
Q_OBJECT
public:
DebuggerRunControl(DebuggerManager *manager,
const DebuggerStartParameters &startParameters);
void setCustomEnvironment(ProjectExplorer::Environment env);
// ProjectExplorer::RunControl
2008-12-02 12:01:29 +01:00
virtual void start();
virtual void stop();
virtual bool isRunning() const;
QString displayName() const;
2008-12-02 12:01:29 +01:00
Q_SLOT void debuggingFinished();
const DebuggerStartParameters &sp() const { return m_startParameters; }
2009-02-16 13:29:57 +01:00
signals:
void stopRequested();
2008-12-02 12:01:29 +01:00
private slots:
void slotAddToOutputWindowInline(const QString &output, bool onStdErr);
void slotMessageAvailable(const QString &data, bool isError);
2008-12-02 12:01:29 +01:00
private:
void init();
2008-12-02 12:01:29 +01:00
DebuggerManager *m_manager;
DebuggerStartParameters m_startParameters;
2008-12-02 12:01:29 +01:00
bool m_running;
};
} // namespace Debugger
#endif // DEBUGGERRUNNER_H