Commit ec7c77ca authored by Friedemann Kleint's avatar Friedemann Kleint

Debugger: Work towards exporting DebuggerManager: Introduce d.

Clean out header.
parent b3cf5ae5
......@@ -27,6 +27,7 @@ HEADERS += breakhandler.h \
debuggerplugin.h \
debuggerrunner.h \
debuggertooltip.h \
debuggerstringutils.h \
watchutils.h \
idebuggerengine.h \
imports.h \
......
......@@ -127,6 +127,22 @@ Core::Utils::SavedAction *theDebuggerAction(int code);
bool theDebuggerBoolSetting(int code);
QString theDebuggerStringSetting(int code);
struct DebuggerManagerActions {
QAction *continueAction;
QAction *stopAction;
QAction *resetAction; // FIXME: Should not be needed in a stable release
QAction *stepAction;
QAction *stepOutAction;
QAction *runToLineAction;
QAction *runToFunctionAction;
QAction *jumpToLineAction;
QAction *nextAction;
QAction *watchAction;
QAction *breakAction;
QAction *sepAction;
QAction *reverseDirectionAction;
};
} // namespace Internal
} // namespace Debugger
......
......@@ -28,6 +28,7 @@
**************************************************************************/
#include "debuggeragents.h"
#include "debuggerstringutils.h"
#include "idebuggerengine.h"
#include <coreplugin/coreconstants.h>
......
This diff is collapsed.
......@@ -32,29 +32,26 @@
#include "debuggerconstants.h"
#include <utils/fancymainwindow.h>
#include <QtCore/QByteArray>
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtCore/QSharedPointer>
QT_BEGIN_NAMESPACE
class QAction;
class QAbstractItemModel;
class QDockWidget;
class QLabel;
class QMessageBox;
class QModelIndex;
class QPoint;
class QTimer;
class QWidget;
class QDebug;
class QAbstractItemModel;
class QPoint;
class QVariant;
QT_END_NAMESPACE
namespace Core {
class IOptionsPage;
namespace Utils {
class FancyMainWindow;
}
} // namespace Core
namespace TextEditor {
......@@ -64,15 +61,8 @@ class ITextEditor;
namespace Debugger {
namespace Internal {
typedef QLatin1Char _c;
typedef QLatin1String __;
inline QString _(const char *s) { return QString::fromLatin1(s); }
inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); }
class DebuggerOutputWindow;
class DebuggerRunControl;
class DebuggerPlugin;
class DebugMode;
class BreakHandler;
class BreakpointData;
......@@ -85,6 +75,12 @@ class Symbol;
class ThreadsHandler;
class WatchData;
class WatchHandler;
class IDebuggerEngine;
class GdbEngine;
class ScriptEngine;
class CdbDebugEngine;
struct CdbDebugEnginePrivate;
struct DebuggerManagerActions;
class DebuggerStartParameters
{
......@@ -115,12 +111,6 @@ public:
typedef QSharedPointer<DebuggerStartParameters> DebuggerStartParametersPtr;
QDebug operator<<(QDebug str, const DebuggerStartParameters &);
class IDebuggerEngine;
class GdbEngine;
class ScriptEngine;
class CdbDebugEngine;
struct CdbDebugEnginePrivate;
// Flags for initialization
enum DebuggerEngineTypeFlags
{
......@@ -140,6 +130,8 @@ QDebug operator<<(QDebug d, DebuggerState state);
// DebuggerManager
//
struct DebuggerManagerPrivate;
class DebuggerManager : public QObject
{
Q_OBJECT
......@@ -148,7 +140,8 @@ public:
DebuggerManager();
~DebuggerManager();
friend class CdbDebugEngine;
friend class IDebuggerEngine;
friend class DebuggerPlugin;
friend class CdbDebugEventCallback;
friend class CdbDumperHelper;
friend class CdbExceptionLoggerEventCallback;
......@@ -159,12 +152,12 @@ public:
QList<Core::IOptionsPage*> initializeEngines(unsigned enabledTypeFlags);
Core::Utils::FancyMainWindow *mainWindow() const { return m_mainWindow; }
QLabel *statusLabel() const { return m_statusLabel; }
IDebuggerEngine *currentEngine() const { return m_engine; }
Core::Utils::FancyMainWindow *mainWindow() const;
QLabel *statusLabel() const;
IDebuggerEngine *currentEngine() const;
virtual DebuggerStartParametersPtr startParameters() const;
virtual qint64 inferiorPid() const;
DebuggerStartParametersPtr startParameters() const;
qint64 inferiorPid() const;
void showMessageBox(int icon, const QString &title, const QString &text);
......@@ -243,14 +236,15 @@ private slots:
void startFailed();
private:
ModulesHandler *modulesHandler() { return m_modulesHandler; }
BreakHandler *breakHandler() { return m_breakHandler; }
RegisterHandler *registerHandler() { return m_registerHandler; }
StackHandler *stackHandler() { return m_stackHandler; }
ThreadsHandler *threadsHandler() { return m_threadsHandler; }
WatchHandler *watchHandler() { return m_watchHandler; }
SourceFilesWindow *sourceFileWindow() { return m_sourceFilesWindow; }
QWidget *threadsWindow() const { return m_threadsWindow; }
ModulesHandler *modulesHandler() const;
BreakHandler *breakHandler() const;
RegisterHandler *registerHandler() const;
StackHandler *stackHandler() const;
ThreadsHandler *threadsHandler() const;
WatchHandler *watchHandler() const;
SourceFilesWindow *sourceFileWindow() const;
QWidget *threadsWindow() const;
DebuggerManagerActions debuggerManagerActions() const;
void notifyInferiorStopped();
void notifyInferiorRunning();
......@@ -261,7 +255,6 @@ private:
DebuggerState state() const;
void setState(DebuggerState state);
DebuggerState m_state;
//
// internal implementation
......@@ -280,7 +273,6 @@ private:
public:
// stuff in this block should be made private by moving it to
// one of the interfaces
int status() const { return m_status; }
QList<Symbol> moduleSymbols(const QString &moduleName);
signals:
......@@ -312,64 +304,7 @@ private:
void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
// FIXME: Remove engine-specific state
DebuggerStartParametersPtr m_startParameters;
qint64 m_inferiorPid;
/// Views
Core::Utils::FancyMainWindow *m_mainWindow;
QLabel *m_statusLabel;
QDockWidget *m_breakDock;
QDockWidget *m_modulesDock;
QDockWidget *m_outputDock;
QDockWidget *m_registerDock;
QDockWidget *m_stackDock;
QDockWidget *m_sourceFilesDock;
QDockWidget *m_threadsDock;
QDockWidget *m_watchDock;
BreakHandler *m_breakHandler;
ModulesHandler *m_modulesHandler;
RegisterHandler *m_registerHandler;
StackHandler *m_stackHandler;
ThreadsHandler *m_threadsHandler;
WatchHandler *m_watchHandler;
SourceFilesWindow *m_sourceFilesWindow;
/// Actions
friend class DebuggerPlugin;
friend class IDebuggerEngine;
QAction *m_continueAction;
QAction *m_stopAction;
QAction *m_resetAction; // FIXME: Should not be needed in a stable release
QAction *m_stepAction;
QAction *m_stepOutAction;
QAction *m_runToLineAction;
QAction *m_runToFunctionAction;
QAction *m_jumpToLineAction;
QAction *m_nextAction;
QAction *m_watchAction;
QAction *m_breakAction;
QAction *m_sepAction;
QAction *m_reverseDirectionAction;
QWidget *m_breakWindow;
QWidget *m_localsWindow;
QWidget *m_registerWindow;
QWidget *m_modulesWindow;
QWidget *m_stackWindow;
QWidget *m_threadsWindow;
QWidget *m_watchersWindow;
DebuggerOutputWindow *m_outputWindow;
int m_status;
bool m_busy;
QTimer *m_statusTimer;
QString m_lastPermanentStatusMessage;
IDebuggerEngine *engine();
IDebuggerEngine *m_engine;
DebuggerManagerPrivate *d;
};
} // namespace Internal
......
......@@ -37,6 +37,7 @@
#include "debuggermanager.h"
#include "debuggerrunner.h"
#include "stackframe.h"
#include "debuggerstringutils.h"
#include "ui_commonoptionspage.h"
#include "ui_dumperoptionpage.h"
......@@ -619,7 +620,8 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
Core::Command *cmd = 0;
cmd = am->registerAction(m_manager->m_continueAction,
const DebuggerManagerActions actions = m_manager->debuggerManagerActions();
cmd = am->registerAction(actions.continueAction,
ProjectExplorer::Constants::DEBUG, QList<int>() << m_gdbRunningContext);
mstart->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
......@@ -648,7 +650,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
Constants::DETACH, globalcontext);
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
cmd = am->registerAction(m_manager->m_stopAction,
cmd = am->registerAction(actions.stopAction,
Constants::INTERRUPT, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setAttribute(Core::Command::CA_UpdateIcon);
......@@ -656,7 +658,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd->setDefaultText(tr("Stop Debugger/Interrupt Debugger"));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
cmd = am->registerAction(m_manager->m_resetAction,
cmd = am->registerAction(actions.resetAction,
Constants::RESET, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultKeySequence(QKeySequence(Constants::RESET_KEY));
......@@ -668,17 +670,17 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep.Step"), globalcontext);
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_nextAction,
cmd = am->registerAction(actions.nextAction,
Constants::NEXT, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::NEXT_KEY));
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_stepAction,
cmd = am->registerAction(actions.stepAction,
Constants::STEP, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::STEP_KEY));
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_stepOutAction,
cmd = am->registerAction(actions.stepOutAction,
Constants::STEPOUT, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::STEPOUT_KEY));
mdebug->addAction(cmd);
......@@ -687,22 +689,22 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
Constants::STEP_BY_INSTRUCTION, debuggercontext);
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_runToLineAction,
cmd = am->registerAction(actions.runToLineAction,
Constants::RUN_TO_LINE, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::RUN_TO_LINE_KEY));
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_runToFunctionAction,
cmd = am->registerAction(actions.runToFunctionAction,
Constants::RUN_TO_FUNCTION, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::RUN_TO_FUNCTION_KEY));
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_jumpToLineAction,
cmd = am->registerAction(actions.jumpToLineAction,
Constants::JUMP_TO_LINE, debuggercontext);
mdebug->addAction(cmd);
#ifdef USE_REVERSE_DEBUGGING
cmd = am->registerAction(m_manager->m_reverseDirectionAction,
cmd = am->registerAction(actions.reverseDirectionAction,
Constants::REVERSE, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::REVERSE_KEY));
mdebug->addAction(cmd);
......@@ -713,7 +715,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep.Break"), globalcontext);
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_breakAction,
cmd = am->registerAction(actions.breakAction,
Constants::TOGGLE_BREAK, cppeditorcontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::TOGGLE_BREAK_KEY));
mdebug->addAction(cmd);
......@@ -724,7 +726,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep.Watch"), globalcontext);
mdebug->addAction(cmd);
cmd = am->registerAction(m_manager->m_watchAction,
cmd = am->registerAction(actions.watchAction,
Constants::ADD_TO_WATCH, cppeditorcontext);
//cmd->setDefaultKeySequence(QKeySequence(tr("ALT+D,ALT+W")));
mdebug->addAction(cmd);
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** 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.
**
** GNU Lesser General Public License Usage
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef DEBUGGERSTRINGUTILS_H
#define DEBUGGERSTRINGUTILS_H
#include <QtCore/QString>
namespace Debugger {
namespace Internal {
typedef QLatin1Char _c;
typedef QLatin1String __;
inline QString _(const char *s) { return QString::fromLatin1(s); }
inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); }
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGERSTRINGUTILS_H
......@@ -32,6 +32,7 @@
#include "debuggeractions.h"
#include "gdbengine.h"
#include "procinterrupt.h"
#include "debuggerstringutils.h"
#include <utils/qtcassert.h>
......
......@@ -31,6 +31,7 @@
#include "debuggeractions.h"
#include "gdbengine.h"
#include "debuggerstringutils.h"
#include <utils/qtcassert.h>
......
......@@ -46,6 +46,7 @@
#include "debuggerconstants.h"
#include "debuggermanager.h"
#include "debuggertooltip.h"
#include "debuggerstringutils.h"
#include "gdbmi.h"
#include "breakhandler.h"
......@@ -58,6 +59,7 @@
#include "debuggerdialogs.h"
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
#include <texteditor/itexteditor.h>
#include <coreplugin/icore.h>
......@@ -224,6 +226,11 @@ DebuggerStartMode GdbEngine::startMode() const
return m_startParameters->startMode;
}
QMainWindow *GdbEngine::mainWindow() const
{
return m_manager->mainWindow();
}
GdbEngine::~GdbEngine()
{
// prevent sending error messages afterwards
......
......@@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE
class QAction;
class QAbstractItemModel;
class QWidget;
class QMainWindow;
QT_END_NAMESPACE
namespace Debugger {
......@@ -271,7 +272,7 @@ private:
bool showToolTip();
// Convenience
QMainWindow *mainWindow() const { return m_manager->mainWindow(); }
QMainWindow *mainWindow() const;
DebuggerStartMode startMode() const;
qint64 inferiorPid() const { return m_manager->inferiorPid(); }
......
......@@ -32,11 +32,14 @@
#include "debuggeractions.h"
#include "gdbengine.h"
#include "procinterrupt.h"
#include "debuggerstringutils.h"
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
#include <coreplugin/icore.h>
#include <QtCore/QFileInfo>
#include <QtCore/QVariant>
#include <QtGui/QMessageBox>
namespace Debugger {
......
......@@ -28,11 +28,12 @@
**************************************************************************/
#include "remotegdbadapter.h"
#include "debuggerstringutils.h"
#include "debuggeractions.h"
#include "gdbengine.h"
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
#include <QtCore/QFileInfo>
#include <QtGui/QMessageBox>
......
......@@ -29,6 +29,7 @@
#include "trkgdbadapter.h"
#include "trkoptions.h"
#include "debuggerstringutils.h"
#ifndef STANDALONE_RUNNER
#include "gdbengine.h"
#endif
......
......@@ -29,6 +29,7 @@
#include "tcfengine.h"
#include "debuggerstringutils.h"
#include "debuggerdialogs.h"
#include "breakhandler.h"
#include "debuggerconstants.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment