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"
|
|
|
|
|
|
2011-01-10 10:35:41 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
|
2016-07-19 11:06:32 +02:00
|
|
|
#include <functional>
|
|
|
|
|
|
2011-01-10 10:35:41 +01:00
|
|
|
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
|
|
|
|
2016-04-12 16:42:15 +02:00
|
|
|
namespace Internal { class DebuggerEngine; }
|
2015-06-04 10:31:27 +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
|
|
|
|
2016-07-19 11:06:32 +02:00
|
|
|
|
|
|
|
|
struct OutputProcessor
|
|
|
|
|
{
|
|
|
|
|
enum OutputChannel
|
|
|
|
|
{
|
|
|
|
|
StandardOut,
|
|
|
|
|
StandardError
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::function<void(const QString &msg, OutputChannel channel)> process;
|
|
|
|
|
bool logToAppOutputPane = true;
|
|
|
|
|
};
|
|
|
|
|
|
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:
|
2016-01-29 12:28:31 +01:00
|
|
|
~DebuggerRunControl() override;
|
2014-10-17 13:40:04 +02:00
|
|
|
|
|
|
|
|
// ProjectExplorer::RunControl
|
2016-01-29 12:28:31 +01:00
|
|
|
void start() override;
|
|
|
|
|
bool promptToStop(bool *prompt = 0) const override;
|
|
|
|
|
StopResult stop() override; // Called from SnapshotWindow.
|
|
|
|
|
QString displayName() const override;
|
2016-04-13 11:11:03 +02:00
|
|
|
bool supportsReRunning() const override;
|
2016-07-19 11:06:32 +02:00
|
|
|
void handleApplicationOutput(const QString &msg, int channel);
|
2014-10-17 13:40:04 +02:00
|
|
|
|
|
|
|
|
void startFailed();
|
2014-12-12 15:33:16 +01:00
|
|
|
void notifyEngineRemoteServerRunning(const QByteArray &msg, int pid);
|
|
|
|
|
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
|
|
|
|
|
void notifyInferiorIll();
|
|
|
|
|
Q_SLOT void notifyInferiorExited();
|
|
|
|
|
void quitDebugger();
|
|
|
|
|
void abortDebugger();
|
2014-10-17 13:40:04 +02:00
|
|
|
void debuggingFinished();
|
2014-12-12 15:33:16 +01:00
|
|
|
|
|
|
|
|
void showMessage(const QString &msg, int channel = LogDebug);
|
|
|
|
|
|
|
|
|
|
DebuggerStartParameters &startParameters();
|
2014-10-17 13:40:04 +02:00
|
|
|
|
2016-07-19 11:06:32 +02:00
|
|
|
void setOutputProcessor(OutputProcessor *processor);
|
|
|
|
|
|
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);
|
2014-10-17 13:40:04 +02:00
|
|
|
|
|
|
|
|
private:
|
2015-02-26 17:43:41 +01:00
|
|
|
void handleFinished();
|
2015-05-27 16:09:43 +02:00
|
|
|
|
2016-04-12 16:42:15 +02:00
|
|
|
friend DebuggerRunControl *createHelper(ProjectExplorer::RunConfiguration *runConfig,
|
|
|
|
|
Internal::DebuggerEngine *engine);
|
2015-05-27 16:09:43 +02:00
|
|
|
|
2015-04-22 16:11:00 +02:00
|
|
|
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
|
2014-12-12 15:33:16 +01:00
|
|
|
Internal::DebuggerEngine *engine);
|
2014-10-17 13:40:04 +02:00
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
Internal::DebuggerEngine *m_engine;
|
2016-07-19 11:06:32 +02:00
|
|
|
OutputProcessor *m_outputProcessor = 0;
|
2014-10-17 13:40:04 +02:00
|
|
|
};
|
2011-01-10 10:35:41 +01:00
|
|
|
|
|
|
|
|
} // namespace Debugger
|