2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-09-21 11:09:38 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2009-09-21 11:09:38 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-09-21 11:09:38 +02: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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
2014-10-01 13:21:18 +02:00
|
|
|
** conditions see http://www.qt.io/licensing. For further information
|
|
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2009-09-21 11:09:38 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
#ifndef GDBPROCESS_H
|
|
|
|
|
#define GDBPROCESS_H
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2013-05-03 13:52:52 +02:00
|
|
|
#include <utils/qtcprocess.h>
|
|
|
|
|
|
2009-09-21 11:09:38 +02:00
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
class GdbProcess : public QObject
|
2009-09-21 11:09:38 +02:00
|
|
|
{
|
2013-09-09 16:42:32 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
2009-09-21 11:09:38 +02:00
|
|
|
public:
|
2013-09-09 16:42:32 +02:00
|
|
|
explicit GdbProcess(QObject *parent = 0);
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
QByteArray readAllStandardOutput();
|
|
|
|
|
QByteArray readAllStandardError();
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
void start(const QString &cmd, const QStringList &args);
|
|
|
|
|
bool waitForStarted();
|
|
|
|
|
qint64 write(const QByteArray &data);
|
|
|
|
|
void kill();
|
|
|
|
|
bool interrupt();
|
2013-05-03 13:52:52 +02:00
|
|
|
void setUseCtrlCStub(bool enable);
|
|
|
|
|
void winInterruptByCtrlC();
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
QProcess::ProcessState state() const;
|
|
|
|
|
QString errorString() const;
|
|
|
|
|
|
|
|
|
|
QProcessEnvironment processEnvironment() const;
|
|
|
|
|
void setProcessEnvironment(const QProcessEnvironment &env);
|
|
|
|
|
void setEnvironment(const QStringList &env);
|
|
|
|
|
void setWorkingDirectory(const QString &dir);
|
2010-05-05 12:49:08 +02:00
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
signals:
|
|
|
|
|
void error(QProcess::ProcessError);
|
|
|
|
|
void finished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
|
|
|
void readyReadStandardError();
|
|
|
|
|
void readyReadStandardOutput();
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2010-05-05 12:49:08 +02:00
|
|
|
private:
|
2013-05-03 13:52:52 +02:00
|
|
|
Utils::QtcProcess m_gdbProc;
|
2011-10-12 16:34:02 +02:00
|
|
|
QString m_errorString;
|
2009-09-21 11:09:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
#endif // GDBPROCESS_H
|