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
|
|
|
|
2017-04-21 10:10:25 +02:00
|
|
|
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::ToolRunner
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2017-05-03 12:35:00 +02:00
|
|
|
DebuggerRunTool(ProjectExplorer::RunControl *runControl); // Use.
|
|
|
|
|
|
2017-04-21 10:10:25 +02:00
|
|
|
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
|
|
|
|
|
const DebuggerStartParameters &sp,
|
2017-05-03 12:35:00 +02:00
|
|
|
QString *errorMessage = nullptr); // Use rarely.
|
2017-04-21 10:10:25 +02:00
|
|
|
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
|
|
|
|
|
const Internal::DebuggerRunParameters &rp,
|
|
|
|
|
QString *errorMessage = nullptr); // FIXME: Don't use.
|
|
|
|
|
~DebuggerRunTool();
|
|
|
|
|
|
2017-05-03 12:35:00 +02:00
|
|
|
void setStartParameters(const DebuggerStartParameters &sp,
|
|
|
|
|
QString *errorMessage = nullptr); // Use rarely.
|
|
|
|
|
void setRunParameters(const Internal::DebuggerRunParameters &rp,
|
|
|
|
|
QString *errorMessage = nullptr); // FIXME: Don't use.
|
|
|
|
|
|
2017-04-21 10:10:25 +02:00
|
|
|
Internal::DebuggerEngine *engine() const { return m_engine; }
|
|
|
|
|
|
2017-04-21 17:20:57 +02:00
|
|
|
void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1);
|
|
|
|
|
|
2017-04-27 15:39:30 +02:00
|
|
|
void prepare() override;
|
2017-04-27 09:53:07 +02:00
|
|
|
void start() override;
|
|
|
|
|
void stop() override;
|
2017-05-02 15:03:56 +02:00
|
|
|
void onTargetFailure() override;
|
2017-05-04 08:11:04 +02:00
|
|
|
void onFinished() override;
|
2017-04-21 10:10:25 +02:00
|
|
|
|
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-05-03 12:35:00 +02:00
|
|
|
bool isCppDebugging() const { return m_isCppDebugging; }
|
|
|
|
|
bool isQmlDebugging() const { return m_isQmlDebugging; }
|
|
|
|
|
|
2017-04-26 14:23:39 +02:00
|
|
|
signals:
|
|
|
|
|
void stateChanged(Debugger::DebuggerState state);
|
|
|
|
|
void aboutToNotifyInferiorSetupOk();
|
|
|
|
|
void requestRemoteSetup();
|
|
|
|
|
|
2017-04-21 10:10:25 +02:00
|
|
|
private:
|
|
|
|
|
Internal::DebuggerEngine *m_engine = nullptr; // Master engine
|
|
|
|
|
QStringList m_errors;
|
2017-05-03 12:35:00 +02:00
|
|
|
const bool m_isCppDebugging;
|
|
|
|
|
const bool m_isQmlDebugging;
|
2017-04-21 10:10:25 +02:00
|
|
|
};
|
|
|
|
|
|
2011-01-10 10:35:41 +01:00
|
|
|
} // namespace Debugger
|