2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-01-10 10:35:41 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-01-10 10:35:41 +01:00
|
|
|
|
2014-10-17 13:40:04 +02:00
|
|
|
#include "debugger_global.h"
|
2014-10-17 13:06:37 +02:00
|
|
|
#include "debuggerconstants.h"
|
2017-04-21 10:10:25 +02:00
|
|
|
#include "debuggerengine.h"
|
2014-10-17 13:06:37 +02:00
|
|
|
|
2011-01-10 10:35:41 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
2012-08-15 13:21:37 +02:00
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
class RemoteSetupResult;
|
2012-08-15 13:21:37 +02:00
|
|
|
class DebuggerStartParameters;
|
2015-05-27 16:09:43 +02:00
|
|
|
class DebuggerRunControl;
|
2012-08-15 13:21:37 +02:00
|
|
|
|
2015-05-27 16:09:43 +02:00
|
|
|
DEBUGGER_EXPORT DebuggerRunControl *createDebuggerRunControl(const DebuggerStartParameters &sp,
|
2015-06-26 13:06:08 +02:00
|
|
|
ProjectExplorer::RunConfiguration *runConfig,
|
|
|
|
|
QString *errorMessage,
|
2015-06-29 10:36:29 +03:00
|
|
|
Core::Id runMode = ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
2015-05-27 16:09:43 +02:00
|
|
|
|
2017-04-21 10:10:25 +02:00
|
|
|
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::ToolRunner
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
|
|
|
|
|
const DebuggerStartParameters &sp,
|
|
|
|
|
QString *errorMessage = nullptr); // Use.
|
|
|
|
|
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
|
|
|
|
|
const Internal::DebuggerRunParameters &rp,
|
|
|
|
|
QString *errorMessage = nullptr); // FIXME: Don't use.
|
|
|
|
|
~DebuggerRunTool();
|
|
|
|
|
|
|
|
|
|
Internal::DebuggerEngine *engine() const { return m_engine; }
|
|
|
|
|
DebuggerRunControl *runControl() const;
|
|
|
|
|
|
2017-04-21 17:20:57 +02:00
|
|
|
void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1);
|
|
|
|
|
|
|
|
|
|
void startIt();
|
|
|
|
|
void stopIt();
|
2017-04-21 10:10:25 +02:00
|
|
|
|
|
|
|
|
void handleFinished();
|
|
|
|
|
|
2017-04-21 17:20:57 +02:00
|
|
|
void startFailed();
|
|
|
|
|
void notifyEngineRemoteServerRunning(const QByteArray &msg, int pid);
|
|
|
|
|
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
|
|
|
|
|
void notifyInferiorIll();
|
|
|
|
|
Q_SLOT void notifyInferiorExited();
|
|
|
|
|
void quitDebugger();
|
|
|
|
|
void abortDebugger();
|
|
|
|
|
void debuggingFinished();
|
|
|
|
|
|
|
|
|
|
DebuggerStartParameters &startParameters(); // Used in Boot2Qt.
|
|
|
|
|
|
2017-04-21 10:10:25 +02:00
|
|
|
private:
|
|
|
|
|
Internal::DebuggerEngine *m_engine = nullptr; // Master engine
|
|
|
|
|
QStringList m_errors;
|
|
|
|
|
};
|
|
|
|
|
|
2016-01-29 12:28:31 +01:00
|
|
|
class DEBUGGER_EXPORT DebuggerRunControl : public ProjectExplorer::RunControl
|
2014-10-17 13:40:04 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2017-04-07 10:21:27 +02:00
|
|
|
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig, Core::Id runMode);
|
2016-01-29 12:28:31 +01:00
|
|
|
~DebuggerRunControl() override;
|
2014-10-17 13:40:04 +02:00
|
|
|
|
2016-01-29 12:28:31 +01:00
|
|
|
void start() override;
|
2017-03-13 13:48:55 +01:00
|
|
|
void stop() override; // Called from SnapshotWindow.
|
2014-10-17 13:40:04 +02:00
|
|
|
|
2017-04-21 17:20:57 +02:00
|
|
|
DebuggerRunTool *toolRunner() const;
|
2014-10-17 13:40:04 +02:00
|
|
|
|
|
|
|
|
signals:
|
2014-12-12 15:33:16 +01:00
|
|
|
void requestRemoteSetup();
|
|
|
|
|
void aboutToNotifyInferiorSetupOk();
|
|
|
|
|
void stateChanged(Debugger::DebuggerState state);
|
2017-04-21 08:53:10 +02:00
|
|
|
|
|
|
|
|
public:
|
2017-04-21 17:20:57 +02:00
|
|
|
DebuggerRunTool *m_debuggerTool = nullptr;
|
2014-10-17 13:40:04 +02:00
|
|
|
};
|
2011-01-10 10:35:41 +01:00
|
|
|
|
|
|
|
|
} // namespace Debugger
|