2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef DEBUGGERPLUGIN_H
|
|
|
|
|
#define DEBUGGERPLUGIN_H
|
|
|
|
|
|
|
|
|
|
#include <extensionsystem/iplugin.h>
|
|
|
|
|
|
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QAction;
|
2010-03-11 11:07:16 +01:00
|
|
|
class QComboBox;
|
2009-01-28 14:29:54 +01:00
|
|
|
class QMenu;
|
|
|
|
|
class QPoint;
|
2010-03-11 11:07:16 +01:00
|
|
|
class QToolButton;
|
2008-12-02 12:01:29 +01:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2009-01-28 14:29:54 +01:00
|
|
|
namespace Core {
|
|
|
|
|
class IEditor;
|
|
|
|
|
class IMode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace TextEditor {
|
|
|
|
|
class ITextEditor;
|
2009-08-14 13:04:05 +02:00
|
|
|
class ITextMark;
|
|
|
|
|
class BaseTextMark;
|
2009-01-28 14:29:54 +01:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
2010-02-09 20:44:40 +01:00
|
|
|
|
2009-09-25 16:01:28 +02:00
|
|
|
class DebuggerManager;
|
2010-02-09 20:44:40 +01:00
|
|
|
class DebuggerUISwitcher;
|
2009-09-25 16:01:28 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2009-04-28 15:08:52 +02:00
|
|
|
class BreakpointData;
|
2009-09-25 11:35:44 +02:00
|
|
|
class DebuggerRunControlFactory;
|
2008-12-02 12:01:29 +01:00
|
|
|
class DebugMode;
|
|
|
|
|
|
|
|
|
|
class DebuggerPlugin : public ExtensionSystem::IPlugin
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2009-12-14 18:01:39 +01:00
|
|
|
struct AttachRemoteParameters {
|
|
|
|
|
AttachRemoteParameters();
|
|
|
|
|
|
|
|
|
|
quint64 attachPid;
|
|
|
|
|
QString attachCore;
|
|
|
|
|
// Event handle for attaching to crashed Windows processes.
|
|
|
|
|
quint64 winCrashEvent;
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
DebuggerPlugin();
|
|
|
|
|
~DebuggerPlugin();
|
|
|
|
|
|
|
|
|
|
private:
|
2009-05-25 16:22:11 +02:00
|
|
|
virtual bool initialize(const QStringList &arguments, QString *error_message);
|
|
|
|
|
virtual void shutdown();
|
|
|
|
|
virtual void extensionsInitialized();
|
2009-12-14 18:01:39 +01:00
|
|
|
virtual void remoteCommand(const QStringList &options, const QStringList &arguments);
|
2009-05-25 16:22:11 +02:00
|
|
|
|
|
|
|
|
QVariant configValue(const QString &name) const;
|
2010-03-10 13:58:20 +01:00
|
|
|
TextEditor::ITextEditor *currentTextEditor();
|
2010-03-10 13:46:05 +01:00
|
|
|
QVariant sessionValue(const QString &name);
|
|
|
|
|
void setSessionValue(const QString &name, const QVariant &value);
|
|
|
|
|
void setConfigValue(const QString &name, const QVariant &value);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void activatePreviousMode();
|
|
|
|
|
void activateDebugMode();
|
|
|
|
|
void editorOpened(Core::IEditor *);
|
|
|
|
|
void editorAboutToClose(Core::IEditor *);
|
2009-09-25 08:35:31 +02:00
|
|
|
void handleStateChanged(int state);
|
2008-12-02 12:01:29 +01:00
|
|
|
void requestMark(TextEditor::ITextEditor *editor, int lineNumber);
|
|
|
|
|
void showToolTip(TextEditor::ITextEditor *editor, const QPoint &pnt, int pos);
|
2008-12-05 16:39:33 +01:00
|
|
|
void requestContextMenu(TextEditor::ITextEditor *editor,
|
|
|
|
|
int lineNumber, QMenu *menu);
|
2009-05-07 15:20:44 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void resetLocation();
|
2009-09-29 15:21:28 +02:00
|
|
|
void gotoLocation(const QString &file, int line, bool setMarker);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-04-28 15:08:52 +02:00
|
|
|
void breakpointSetRemoveMarginActionTriggered();
|
|
|
|
|
void breakpointEnableDisableMarginActionTriggered();
|
2009-05-15 16:54:54 +02:00
|
|
|
void onModeChanged(Core::IMode *mode);
|
2009-02-27 11:41:19 +01:00
|
|
|
void showSettingsDialog();
|
2008-12-05 16:39:33 +01:00
|
|
|
|
2009-05-05 17:48:54 +02:00
|
|
|
void startExternalApplication();
|
2009-05-06 13:27:11 +02:00
|
|
|
void startRemoteApplication();
|
2009-05-05 17:48:54 +02:00
|
|
|
void attachExternalApplication();
|
|
|
|
|
void attachCore();
|
2009-12-14 18:01:39 +01:00
|
|
|
void attachCmdLine();
|
2009-05-05 17:48:54 +02:00
|
|
|
|
2010-03-11 11:07:16 +01:00
|
|
|
void enableReverseDebuggingTriggered(const QVariant &value);
|
2010-03-18 10:56:25 +01:00
|
|
|
void languageChanged(const QString &debuggerLanguage);
|
2010-03-11 11:07:16 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2009-01-13 18:15:24 +01:00
|
|
|
void readSettings();
|
|
|
|
|
void writeSettings() const;
|
2010-03-17 10:57:19 +01:00
|
|
|
void attachExternalApplication(qint64 pid,
|
|
|
|
|
const QString &binary,
|
|
|
|
|
const QString &crashParameter);
|
2009-09-30 12:27:03 +02:00
|
|
|
void attachCore(const QString &core, const QString &exeFileName);
|
2009-01-13 18:15:24 +01:00
|
|
|
|
2009-09-28 11:42:26 +02:00
|
|
|
friend class Debugger::DebuggerManager;
|
2009-01-14 18:09:02 +01:00
|
|
|
friend class GdbOptionPage;
|
2009-04-07 16:39:17 +02:00
|
|
|
friend class DebuggingHelperOptionPage;
|
2010-03-11 11:07:16 +01:00
|
|
|
// FIXME: Just a hack now so that it can access the views.
|
|
|
|
|
friend class Debugger::Internal::DebugMode;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-02-09 20:44:40 +01:00
|
|
|
DebuggerUISwitcher *m_uiSwitcher;
|
2008-12-02 12:01:29 +01:00
|
|
|
DebuggerManager *m_manager;
|
|
|
|
|
DebugMode *m_debugMode;
|
2009-09-25 11:35:44 +02:00
|
|
|
DebuggerRunControlFactory *m_debuggerRunControlFactory;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QString m_previousMode;
|
2009-08-14 13:04:05 +02:00
|
|
|
TextEditor::BaseTextMark *m_locationMark;
|
2008-12-02 12:01:29 +01:00
|
|
|
int m_gdbRunningContext;
|
2009-12-14 18:01:39 +01:00
|
|
|
AttachRemoteParameters m_attachRemoteParameters;
|
2009-05-25 16:22:11 +02:00
|
|
|
unsigned m_cmdLineEnabledEngines;
|
2009-12-14 18:01:39 +01:00
|
|
|
|
2009-05-05 17:48:54 +02:00
|
|
|
QAction *m_startExternalAction;
|
2009-05-06 13:27:11 +02:00
|
|
|
QAction *m_startRemoteAction;
|
2009-05-05 17:48:54 +02:00
|
|
|
QAction *m_attachExternalAction;
|
|
|
|
|
QAction *m_attachCoreAction;
|
2009-05-07 15:20:44 +02:00
|
|
|
QAction *m_detachAction;
|
2010-02-09 20:44:40 +01:00
|
|
|
QComboBox *m_langBox;
|
2010-03-11 11:07:16 +01:00
|
|
|
QToolButton *m_reverseToolButton;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGERPLUGIN_H
|