2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
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
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** 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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** 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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** 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
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef DEBUGGERRUNNER_H
|
|
|
|
|
#define DEBUGGERRUNNER_H
|
|
|
|
|
|
2010-04-15 11:59:22 +02:00
|
|
|
#include "debugger_global.h"
|
2010-06-11 17:03:15 +02:00
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
2010-06-11 16:31:54 +02:00
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
2010-06-15 08:22:02 +02:00
|
|
|
class Environment;
|
2010-06-11 16:31:54 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-15 08:22:02 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Debugger {
|
2010-06-11 17:03:15 +02:00
|
|
|
|
2010-06-23 11:55:35 +02:00
|
|
|
class DebuggerRunControl;
|
2010-06-16 11:08:54 +02:00
|
|
|
class DebuggerStartParameters;
|
2010-06-11 17:03:15 +02:00
|
|
|
|
2010-06-15 08:22:02 +02:00
|
|
|
namespace Internal {
|
2010-06-16 11:08:54 +02:00
|
|
|
class DebuggerEngine;
|
2010-08-25 16:48:35 +02:00
|
|
|
class QmlEngine;
|
2010-09-13 11:08:08 +02:00
|
|
|
class GdbEngine;
|
|
|
|
|
class AbstractGdbAdapter;
|
2010-06-15 08:22:02 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-11 17:03:15 +02:00
|
|
|
//DEBUGGER_EXPORT QDebug operator<<(QDebug str, const DebuggerStartParameters &);
|
|
|
|
|
|
2010-04-15 11:59:22 +02:00
|
|
|
class DEBUGGER_EXPORT DebuggerRunControlFactory
|
2009-09-25 11:35:44 +02:00
|
|
|
: public ProjectExplorer::IRunControlFactory
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2010-06-16 11:08:54 +02:00
|
|
|
DebuggerRunControlFactory(QObject *parent, DebuggerEngineType enabledEngines);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-11 16:06:13 +02:00
|
|
|
// This is used by the "Non-Standard" scenarios, e.g. Attach to Core.
|
2010-06-22 12:41:41 +02:00
|
|
|
// FIXME: What to do in case of a 0 runConfiguration?
|
2010-07-20 16:34:39 +02:00
|
|
|
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
|
|
|
|
typedef ProjectExplorer::RunControl RunControl;
|
2010-06-23 11:55:35 +02:00
|
|
|
DebuggerRunControl *create(const DebuggerStartParameters &sp,
|
2010-07-20 16:34:39 +02:00
|
|
|
RunConfiguration *runConfiguration = 0);
|
2009-07-28 09:10:35 +02:00
|
|
|
|
2010-07-20 16:34:39 +02:00
|
|
|
// ProjectExplorer::IRunControlFactory
|
|
|
|
|
// FIXME: Used by qmljsinspector.cpp:469
|
|
|
|
|
RunControl *create(RunConfiguration *runConfiguration, const QString &mode);
|
|
|
|
|
bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2010-07-20 16:34:39 +02:00
|
|
|
QString displayName() const;
|
|
|
|
|
QWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
DebuggerEngineType m_enabledEngines;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2010-06-15 08:22:02 +02:00
|
|
|
// This is a job description containing all data "local" to the jobs, including
|
|
|
|
|
// the models of the individual debugger views.
|
2010-04-15 11:59:22 +02:00
|
|
|
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:
|
2010-07-21 17:06:22 +02:00
|
|
|
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
2010-08-20 15:23:42 +02:00
|
|
|
explicit DebuggerRunControl(RunConfiguration *runConfiguration,
|
2010-07-20 16:34:39 +02:00
|
|
|
DebuggerEngineType enabledEngines, const DebuggerStartParameters &sp);
|
2010-06-15 08:22:02 +02:00
|
|
|
~DebuggerRunControl();
|
2009-05-25 16:22:11 +02:00
|
|
|
|
2009-05-05 17:48:54 +02:00
|
|
|
// ProjectExplorer::RunControl
|
2008-12-02 12:01:29 +01:00
|
|
|
virtual void start();
|
2010-08-20 14:19:25 +02:00
|
|
|
virtual bool aboutToStop() const;
|
|
|
|
|
virtual StopResult stop();
|
2008-12-02 12:01:29 +01:00
|
|
|
virtual bool isRunning() const;
|
2010-06-07 16:40:33 +02:00
|
|
|
QString displayName() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void createEngine(const DebuggerStartParameters &startParameters);
|
2010-06-15 08:22:02 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void setCustomEnvironment(ProjectExplorer::Environment env);
|
|
|
|
|
void setEnabledEngines(DebuggerEngineType enabledEngines);
|
2010-06-14 08:57:15 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void startFailed();
|
|
|
|
|
void debuggingFinished();
|
2010-07-21 17:06:22 +02:00
|
|
|
RunConfiguration *runConfiguration() const { return m_myRunConfiguration.data(); }
|
2010-06-15 12:47:37 +02:00
|
|
|
|
2010-06-22 12:28:05 +02:00
|
|
|
DebuggerState state() const;
|
2010-06-16 11:08:54 +02:00
|
|
|
Internal::DebuggerEngine *engine();
|
2010-06-15 09:13:22 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void showMessage(const QString &msg, int channel);
|
2009-02-16 13:29:57 +01:00
|
|
|
|
2010-09-13 11:08:08 +02:00
|
|
|
void remoteGdbHandleSetupDone();
|
|
|
|
|
void remoteGdbHandleSetupFailed(const QString &message);
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
static bool checkDebugConfiguration(int toolChain,
|
|
|
|
|
QString *errorMessage,
|
|
|
|
|
QString *settingsCategory = 0,
|
|
|
|
|
QString *settingsPage = 0);
|
2010-06-14 17:23:25 +02:00
|
|
|
|
2010-09-13 11:08:08 +02:00
|
|
|
signals:
|
|
|
|
|
void gdbAdapterRequestSetup();
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private slots:
|
2010-06-16 11:08:54 +02:00
|
|
|
void handleFinished();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-08-20 15:23:42 +02:00
|
|
|
protected:
|
|
|
|
|
const DebuggerStartParameters &startParameters() const;
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2010-06-16 11:08:54 +02:00
|
|
|
DebuggerEngineType engineForExecutable(const QString &executable);
|
|
|
|
|
DebuggerEngineType engineForMode(DebuggerStartMode mode);
|
2010-09-13 11:08:08 +02:00
|
|
|
void initGdbEngine(Internal::GdbEngine *engine);
|
|
|
|
|
Internal::GdbEngine *gdbEngine() const;
|
|
|
|
|
Internal::AbstractGdbAdapter *gdbAdapter() const;
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
Internal::DebuggerEngine *m_engine;
|
2010-07-21 17:06:22 +02:00
|
|
|
const QWeakPointer<RunConfiguration> m_myRunConfiguration;
|
2010-06-16 11:08:54 +02:00
|
|
|
bool m_running;
|
2010-08-18 13:54:12 +02:00
|
|
|
bool m_started;
|
2010-06-16 11:08:54 +02:00
|
|
|
DebuggerEngineType m_enabledEngines;
|
|
|
|
|
QString m_errorMessage;
|
|
|
|
|
QString m_settingsIdHint;
|
2010-08-25 16:48:35 +02:00
|
|
|
friend class Internal::QmlEngine;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGERRUNNER_H
|