1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
9 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
14 ** Please review the following information to ensure the GNU Lesser General
15 ** Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
24 ** Alternatively, this file may be used in accordance with the terms and
25 ** conditions contained in a signed written agreement between you and Nokia.
27 ** If you have questions regarding the use of this file, please contact
28 ** Nokia at qt-info@nokia.com.
30 **************************************************************************/
32 #ifndef MAEMODEBUGSUPPORT_H
33 #define MAEMODEBUGSUPPORT_H
35 #include "maemorunconfiguration.h"
37 #include <utils/ssh/sftpdefs.h>
38 #include <utils/environment.h>
40 #include <QtCore/QObject>
41 #include <QtCore/QPointer>
42 #include <QtCore/QSharedPointer>
44 namespace Core { class SftpChannel; }
50 namespace ProjectExplorer { class RunControl; }
52 namespace Qt4ProjectManager {
55 class MaemoDeviceConfig;
56 class MaemoRunConfiguration;
59 class MaemoDebugSupport : public QObject
63 static ProjectExplorer::RunControl *createDebugRunControl(MaemoRunConfiguration *runConfig);
65 MaemoDebugSupport(MaemoRunConfiguration *runConfig,
66 Debugger::DebuggerEngine *engine, bool useGdb);
69 static QString uploadDir(const QSharedPointer<const MaemoDeviceConfig> &devConf);
72 void handleAdapterSetupRequested();
73 void handleSshError(const QString &error);
74 void startExecution();
75 void handleSftpChannelInitialized();
76 void handleSftpChannelInitializationFailed(const QString &error);
77 void handleSftpJobFinished(Utils::SftpJobId job, const QString &error);
78 void handleDebuggingFinished();
79 void handleRemoteOutput(const QByteArray &output);
80 void handleRemoteErrorOutput(const QByteArray &output);
81 void handleProgressReport(const QString &progressOutput);
82 void handleRemoteProcessStarted();
86 Inactive, StartingRunner, InitializingUploader, UploadingDumpers,
87 DumpersUploaded, StartingRemoteProcess, Debugging
90 void handleAdapterSetupFailed(const QString &error);
91 void handleAdapterSetupDone();
92 void startDebugging();
94 void setState(State newState);
95 bool setPort(int &port);
97 void showMessage(const QString &msg, int channel);
98 const QPointer<Debugger::DebuggerEngine> m_engine;
99 const QPointer<MaemoRunConfiguration> m_runConfig;
100 const QSharedPointer<const MaemoDeviceConfig> m_deviceConfig;
101 MaemoSshRunner * const m_runner;
102 const MaemoRunConfiguration::DebuggingType m_debuggingType;
103 const QString m_dumperLib;
104 const QList<Utils::EnvironmentItem> m_userEnvChanges;
106 QSharedPointer<Utils::SftpChannel> m_uploader;
107 Utils::SftpJobId m_uploadJob;
108 QByteArray m_gdbserverOutput;
115 } // namespace Internal
116 } // namespace Qt4ProjectManager
118 #endif // MAEMODEBUGSUPPORT_H