Commit 4e5089d9 authored by Lasse Holmstedt's avatar Lasse Holmstedt

Merge branch 'debugintegration'

Conflicts:
	src/plugins/qmlprojectmanager/qmlproject.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
parents 5262ca20 580280af
......@@ -43,7 +43,9 @@ HEADERS += breakhandler.h \
threadswindow.h \
watchhandler.h \
watchwindow.h \
name_demangler.h
name_demangler.h \
debuggeruiswitcher.h \
debuggermainwindow.h
SOURCES += breakhandler.cpp \
breakwindow.cpp \
breakwindow.h \
......@@ -70,7 +72,10 @@ SOURCES += breakhandler.cpp \
threadswindow.cpp \
watchhandler.cpp \
watchwindow.cpp \
name_demangler.cpp
name_demangler.cpp \
debuggeruiswitcher.cpp \
debuggermainwindow.cpp
FORMS += attachexternaldialog.ui \
attachcoredialog.ui \
breakbyfunction.ui \
......
......@@ -38,7 +38,7 @@ namespace Constants {
// modes and their priorities
const char * const MODE_DEBUG = "Debugger.Mode.Debug";
const int P_MODE_DEBUG = 85;
const char * const LANG_CPP = "C++";
// common actions
const char * const INTERRUPT = "Debugger.Interrupt";
const char * const RESET = "Debugger.Reset";
......
#include "debuggermainwindow.h"
#include <QtCore/QCoreApplication>
#include <QtGui/QApplication>
#include <QtGui/QMenu>
#include <QtGui/QLayout>
#include <QtGui/QMainWindow>
#include <QtGui/QDockWidget>
#include <QtGui/QStyle>
#include <QDebug>
namespace Debugger {
DebuggerMainWindow::DebuggerMainWindow(DebuggerUISwitcher *uiSwitcher, QWidget *parent) :
FancyMainWindow(parent), m_uiSwitcher(uiSwitcher)
{
// TODO how to "append" style sheet?
// QString sheet;
// After setting it, all prev. style stuff seem to be ignored.
/* sheet = QLatin1String(
"Debugger--DebuggerMainWindow::separator {"
" background: black;"
" width: 1px;"
" height: 1px;"
"}"
);
setStyleSheet(sheet);
*/
}
DebuggerMainWindow::~DebuggerMainWindow()
{
}
QMenu* DebuggerMainWindow::createPopupMenu()
{
QMenu *menu = 0;
QList<Internal::DebugToolWindow* > dockwidgets = m_uiSwitcher->m_dockWidgets;
if (!dockwidgets.isEmpty()) {
menu = new QMenu(this);
for (int i = 0; i < dockwidgets.size(); ++i) {
QDockWidget *dockWidget = dockwidgets.at(i)->m_dockWidget;
if (dockWidget->parentWidget() == this &&
dockwidgets.at(i)->m_languageId == m_uiSwitcher->m_activeLanguage) {
menu->addAction(dockWidget->toggleViewAction());
}
}
menu->addSeparator();
}
return menu;
}
}
#ifndef DEBUGGERMAINWINDOW_H
#define DEBUGGERMAINWINDOW_H
#include "debuggeruiswitcher.h"
#include <utils/fancymainwindow.h>
class QMenu;
namespace Debugger {
class DebuggerMainWindow : public Utils::FancyMainWindow
{
public:
DebuggerMainWindow(DebuggerUISwitcher *uiSwitcher, QWidget *parent = 0);
~DebuggerMainWindow();
protected:
virtual QMenu *createPopupMenu();
private:
DebuggerUISwitcher *m_uiSwitcher;
};
}
#endif // DEBUGGERMAINWINDOW_H
......@@ -36,6 +36,8 @@
#include "idebuggerengine.h"
#include "debuggerstringutils.h"
#include "watchutils.h"
#include "debuggeruiswitcher.h"
#include "debuggermainwindow.h"
#include "breakwindow.h"
#include "debuggeroutputwindow.h"
......@@ -60,10 +62,10 @@
# include "shared/peutils.h"
#endif
#include <coreplugin/minisplitter.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
#include <projectexplorer/toolchain.h>
#include <cplusplus/CppDocument.h>
#include <cpptools/cppmodelmanagerinterface.h>
......@@ -260,7 +262,7 @@ struct DebuggerManagerPrivate
qint64 m_inferiorPid;
/// Views
Utils::FancyMainWindow *m_mainWindow;
DebuggerMainWindow *m_mainWindow;
QLabel *m_statusLabel;
QDockWidget *m_breakDock;
......@@ -272,6 +274,7 @@ struct DebuggerManagerPrivate
QDockWidget *m_stackDock;
QDockWidget *m_threadsDock;
QDockWidget *m_watchDock;
QList<QDockWidget *> m_dockWidgets;
BreakHandler *m_breakHandler;
ModulesHandler *m_modulesHandler;
......@@ -364,9 +367,7 @@ void DebuggerManager::init()
d->m_watchersWindow = new WatchWindow(WatchWindow::WatchersType, this);
d->m_statusTimer = new QTimer(this);
d->m_mainWindow = new Utils::FancyMainWindow;
d->m_mainWindow->setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
d->m_mainWindow->setDocumentMode(true);
d->m_mainWindow = DebuggerUISwitcher::instance()->mainWindow();
// Snapshots
d->m_snapshotHandler = new SnapshotHandler;
......@@ -551,30 +552,32 @@ void DebuggerManager::init()
connect(theDebuggerAction(OperateByInstruction), SIGNAL(triggered()),
this, SLOT(operateByInstructionTriggered()));
DebuggerUISwitcher *uiSwitcher = DebuggerUISwitcher::instance();
d->m_breakDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_breakWindow);
d->m_modulesDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_modulesWindow,
Qt::TopDockWidgetArea, false);
d->m_breakDock = d->m_mainWindow->addDockForWidget(d->m_breakWindow);
d->m_modulesDock = d->m_mainWindow->addDockForWidget(d->m_modulesWindow);
connect(d->m_modulesDock->toggleViewAction(), SIGNAL(toggled(bool)),
this, SLOT(reloadModules()), Qt::QueuedConnection);
d->m_registerDock = d->m_mainWindow->addDockForWidget(d->m_registerWindow);
d->m_registerDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_registerWindow,
Qt::TopDockWidgetArea, false);
connect(d->m_registerDock->toggleViewAction(), SIGNAL(toggled(bool)),
this, SLOT(reloadRegisters()), Qt::QueuedConnection);
d->m_outputDock = d->m_mainWindow->addDockForWidget(d->m_outputWindow);
d->m_snapshotDock = d->m_mainWindow->addDockForWidget(d->m_snapshotWindow);
d->m_outputDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_outputWindow,
Qt::TopDockWidgetArea, false);
d->m_stackDock = d->m_mainWindow->addDockForWidget(d->m_stackWindow);
d->m_sourceFilesDock = d->m_mainWindow->addDockForWidget(d->m_sourceFilesWindow);
d->m_snapshotDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_snapshotWindow);
d->m_stackDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_stackWindow);
d->m_sourceFilesDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_sourceFilesWindow,
Qt::TopDockWidgetArea, false);
connect(d->m_sourceFilesDock->toggleViewAction(), SIGNAL(toggled(bool)),
this, SLOT(reloadSourceFiles()), Qt::QueuedConnection);
d->m_threadsDock = d->m_mainWindow->addDockForWidget(d->m_threadsWindow);
d->m_threadsDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_threadsWindow);
QSplitter *localsAndWatchers = new QSplitter(Qt::Vertical, 0);
QSplitter *localsAndWatchers = new Core::MiniSplitter(Qt::Vertical);
localsAndWatchers->setWindowTitle(d->m_localsWindow->windowTitle());
localsAndWatchers->addWidget(d->m_localsWindow);
localsAndWatchers->addWidget(d->m_watchersWindow);
......@@ -582,7 +585,10 @@ void DebuggerManager::init()
localsAndWatchers->setStretchFactor(0, 3);
localsAndWatchers->setStretchFactor(1, 1);
localsAndWatchers->setStretchFactor(2, 1);
d->m_watchDock = d->m_mainWindow->addDockForWidget(localsAndWatchers);
d->m_watchDock = DebuggerUISwitcher::instance()->createDockWidget(LANG_CPP, localsAndWatchers);
d->m_dockWidgets << d->m_breakDock << d->m_modulesDock << d->m_registerDock
<< d->m_outputDock << d->m_stackDock << d->m_sourceFilesDock
<< d->m_threadsDock << d->m_watchDock;
setState(DebuggerNotReady);
}
......@@ -613,11 +619,6 @@ DebuggerManagerActions DebuggerManager::debuggerManagerActions() const
return d->m_actions;
}
Utils::FancyMainWindow *DebuggerManager::mainWindow() const
{
return d->m_mainWindow;
}
QLabel *DebuggerManager::statusLabel() const
{
return d->m_statusLabel;
......@@ -687,45 +688,51 @@ QWidget *DebuggerManager::threadsWindow() const
void DebuggerManager::createNewDock(QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), d->m_mainWindow);
QDockWidget *dockWidget = DebuggerUISwitcher::instance()->createDockWidget(LANG_CPP, widget);
dockWidget->setWindowTitle(widget->windowTitle());
dockWidget->setObjectName(widget->windowTitle());
dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
dockWidget->setWidget(widget);
d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
//dockWidget->setWidget(widget);
//d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
dockWidget->show();
}
void DebuggerManager::setSimpleDockWidgetArrangement()
void DebuggerManager::setSimpleDockWidgetArrangement(const QString &activeLanguage)
{
d->m_mainWindow->setTrackingEnabled(false);
QList<QDockWidget *> dockWidgets = d->m_mainWindow->dockWidgets();
foreach (QDockWidget *dockWidget, dockWidgets) {
dockWidget->setFloating(false);
d->m_mainWindow->removeDockWidget(dockWidget);
}
foreach (QDockWidget *dockWidget, dockWidgets) {
if (dockWidget == d->m_outputDock)
d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
else
d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
dockWidget->show();
}
if (activeLanguage == LANG_CPP || !activeLanguage.length()) {
d->m_mainWindow->setTrackingEnabled(false);
QList<QDockWidget *> dockWidgets = d->m_mainWindow->dockWidgets();
foreach (QDockWidget *dockWidget, dockWidgets) {
if (d->m_dockWidgets.contains(dockWidget)) {
dockWidget->setFloating(false);
d->m_mainWindow->removeDockWidget(dockWidget);
}
}
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_breakDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_modulesDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_registerDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_threadsDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_sourceFilesDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_snapshotDock);
foreach (QDockWidget *dockWidget, dockWidgets) {
if (d->m_dockWidgets.contains(dockWidget)) {
if (dockWidget == d->m_outputDock)
d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
else
d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
dockWidget->show();
}
}
// They following views are rarely used in ordinary debugging. Hiding them
// saves cycles since the corresponding information won't be retrieved.
d->m_sourceFilesDock->hide();
d->m_registerDock->hide();
d->m_modulesDock->hide();
d->m_outputDock->hide();
d->m_mainWindow->setTrackingEnabled(true);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_breakDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_modulesDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_registerDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_threadsDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_sourceFilesDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_snapshotDock);
// They following views are rarely used in ordinary debugging. Hiding them
// saves cycles since the corresponding information won't be retrieved.
d->m_sourceFilesDock->hide();
d->m_registerDock->hide();
d->m_modulesDock->hide();
d->m_outputDock->hide();
d->m_mainWindow->setTrackingEnabled(true);
}
}
QAbstractItemModel *DebuggerManager::threadsModel()
......@@ -1248,7 +1255,7 @@ void DebuggerManager::saveSessionData()
void DebuggerManager::dumpLog()
{
QString fileName = QFileDialog::getSaveFileName(mainWindow(),
QString fileName = QFileDialog::getSaveFileName(d->m_mainWindow,
tr("Save Debugger Log"), QDir::tempPath());
if (fileName.isEmpty())
return;
......@@ -1575,7 +1582,7 @@ QStringList DebuggerManager::qtDumperLibraryLocations() const
void DebuggerManager::showQtDumperLibraryWarning(const QString &details)
{
QMessageBox dialog(mainWindow());
QMessageBox dialog(d->m_mainWindow);
QPushButton *qtPref = dialog.addButton(tr("Open Qt preferences"),
QMessageBox::ActionRole);
QPushButton *helperOff = dialog.addButton(tr("Turn off helper usage"),
......@@ -1636,7 +1643,7 @@ QMessageBox *DebuggerManager::showMessageBox(int icon, const QString &title,
const QString &text, int buttons)
{
QMessageBox *mb = new QMessageBox(QMessageBox::Icon(icon),
title, text, QMessageBox::StandardButtons(buttons), mainWindow());
title, text, QMessageBox::StandardButtons(buttons), d->m_mainWindow);
mb->setAttribute(Qt::WA_DeleteOnClose);
mb->show();
return mb;
......@@ -1748,7 +1755,7 @@ void DebuggerManager::setState(DebuggerState state, bool forced)
const bool stopped = state == InferiorStopped;
if (stopped)
QApplication::alert(mainWindow(), 3000);
QApplication::alert(d->m_mainWindow, 3000);
const bool actionsEnabled = debuggerActionsEnabled();
const unsigned engineCapabilities = debuggerCapabilities();
......
......@@ -53,9 +53,6 @@ QT_END_NAMESPACE
namespace Core {
class IOptionsPage;
}
namespace Utils {
class FancyMainWindow;
}
namespace TextEditor {
class ITextEditor;
......@@ -180,7 +177,6 @@ public:
DebuggerState state() const;
QList<Core::IOptionsPage*> initializeEngines(unsigned enabledTypeFlags);
Utils::FancyMainWindow *mainWindow() const;
QLabel *statusLabel() const;
Internal::IDebuggerEngine *currentEngine() const;
......@@ -208,7 +204,7 @@ public slots:
void startNewDebugger(const DebuggerStartParametersPtr &sp);
void exitDebugger();
void setSimpleDockWidgetArrangement();
void setSimpleDockWidgetArrangement(const QString &activeLanguage);
void setBusyCursor(bool on);
void queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **ed);
......
......@@ -36,6 +36,8 @@
#include "debuggermanager.h"
#include "debuggerrunner.h"
#include "debuggerstringutils.h"
#include "debuggeruiswitcher.h"
#include "debuggermainwindow.h"
#include "ui_commonoptionspage.h"
#include "ui_dumperoptionpage.h"
......@@ -76,7 +78,6 @@
#include <utils/qtcassert.h>
#include <utils/styledbar.h>
#include <utils/fancymainwindow.h>
#include <QtCore/QDebug>
#include <QtCore/QObject>
......@@ -97,6 +98,7 @@
#include <climits>
using namespace Core;
using namespace Debugger;
using namespace Debugger::Constants;
using namespace Debugger::Internal;
using namespace ProjectExplorer;
......@@ -260,7 +262,8 @@ bool DebuggerListener::coreAboutToClose()
" state (%1) can leave the target in an inconsistent state."
" Would you still like to terminate it?")
.arg(QLatin1String(DebuggerManager::stateName(mgr->state())));
QMessageBox::StandardButton answer = QMessageBox::question(mgr->mainWindow(), title, question,
QMessageBox::StandardButton answer = QMessageBox::question(DebuggerUISwitcher::instance()->mainWindow(),
title, question,
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
if (answer != QMessageBox::Yes)
return false;
......@@ -521,8 +524,7 @@ DebuggerPlugin::DebuggerPlugin()
m_debugMode(0),
m_locationMark(0),
m_gdbRunningContext(0),
m_cmdLineEnabledEngines(AllEngineTypes),
m_toggleLockedAction(0)
m_cmdLineEnabledEngines(AllEngineTypes)
{}
DebuggerPlugin::~DebuggerPlugin()
......@@ -535,9 +537,12 @@ void DebuggerPlugin::shutdown()
m_manager->shutdown();
writeSettings();
if (m_uiSwitcher)
m_uiSwitcher->shutdown();
delete DebuggerSettings::instance();
//qDebug() << "DebuggerPlugin::~DebuggerPlugin";
removeObject(m_debugMode);
// FIXME: when using the line below, BreakWindow etc gets deleted twice.
......@@ -551,6 +556,10 @@ void DebuggerPlugin::shutdown()
removeObject(m_manager);
delete m_manager;
m_manager = 0;
removeObject(m_uiSwitcher);
delete m_uiSwitcher;
m_uiSwitcher = 0;
}
static QString msgParameterMissing(const QString &a)
......@@ -658,6 +667,13 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
errorMessage->clear();
}
// Debug mode setup
m_debugMode = new DebugMode(this);
//addAutoReleasedObject(m_debugMode);
m_uiSwitcher = new DebuggerUISwitcher(m_debugMode, this);
ExtensionSystem::PluginManager::instance()->addObject(m_uiSwitcher);
m_uiSwitcher->addLanguage(LANG_CPP);
m_manager = new DebuggerManager;
ExtensionSystem::PluginManager::instance()->addObject(m_manager);
const QList<Core::IOptionsPage *> engineOptionPages =
......@@ -689,6 +705,16 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
// register factory of DebuggerRunControl
m_debuggerRunControlFactory = new DebuggerRunControlFactory(m_manager);
addAutoReleasedObject(m_debuggerRunControlFactory);
QList<int> context;
context.append(uidm->uniqueIdentifier(Core::Constants::C_EDITORMANAGER));
context.append(uidm->uniqueIdentifier(Debugger::Constants::C_GDBDEBUGGER));
context.append(uidm->uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE));
m_debugMode->setContext(context);
//Core::ActionContainer *mcppcontext =
// am->actionContainer(CppEditor::Constants::M_CONTEXT);
......@@ -707,26 +733,26 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
m_attachCoreAction->setText(tr("Attach to Core..."));
connect(m_attachCoreAction, SIGNAL(triggered()), this, SLOT(attachCore()));
m_startRemoteAction = new QAction(this);
m_startRemoteAction->setText(tr("Start and Attach to Remote Application..."));
connect(m_startRemoteAction, SIGNAL(triggered()),
this, SLOT(startRemoteApplication()));
m_detachAction = new QAction(this);
m_detachAction->setText(tr("Detach Debugger"));
connect(m_detachAction, SIGNAL(triggered()),
m_manager, SLOT(detachDebugger()));
Core::ActionContainer *mdebug =
am->actionContainer(ProjectExplorer::Constants::M_DEBUG);
// Core::ActionContainer *mdebug =
// am->actionContainer(ProjectExplorer::Constants::M_DEBUG);
Core::Command *cmd = 0;
const DebuggerManagerActions actions = m_manager->debuggerManagerActions();
Core::ActionContainer *mstart =
am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
Core::Command *cmd = 0;
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);
......@@ -749,7 +775,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd = am->registerAction(m_detachAction,
Constants::DETACH, globalcontext);
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
m_uiSwitcher->addMenuAction(cmd, Core::Constants::G_DEFAULT_ONE);
cmd = am->registerAction(actions.stopAction,
Constants::INTERRUPT, globalcontext);
......@@ -757,90 +783,90 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd->setAttribute(Core::Command::CA_UpdateIcon);
cmd->setDefaultKeySequence(QKeySequence(Constants::INTERRUPT_KEY));
cmd->setDefaultText(tr("Stop Debugger/Interrupt Debugger"));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
m_uiSwitcher->addMenuAction(cmd, Core::Constants::G_DEFAULT_ONE);
cmd = am->registerAction(actions.resetAction,
Constants::RESET, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
//cmd->setDefaultKeySequence(QKeySequence(Constants::RESET_KEY));
cmd->setDefaultText(tr("Reset Debugger"));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
m_uiSwitcher->addMenuAction(cmd, Core::Constants::G_DEFAULT_ONE);
QAction *sep = new QAction(this);
sep->setSeparator(true);
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep.Step"), globalcontext);
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.nextAction,
Constants::NEXT, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::NEXT_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.stepAction,
Constants::STEP, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::STEP_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.stepOutAction,
Constants::STEPOUT, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::STEPOUT_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.runToLineAction1,
Constants::RUN_TO_LINE1, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::RUN_TO_LINE_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.runToFunctionAction,
Constants::RUN_TO_FUNCTION, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::RUN_TO_FUNCTION_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.jumpToLineAction1,
Constants::JUMP_TO_LINE1, debuggercontext);
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.returnFromFunctionAction,
Constants::RETURN_FROM_FUNCTION, debuggercontext);
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
#ifdef USE_REVERSE_DEBUGGING
cmd = am->registerAction(actions.reverseDirectionAction,
Constants::REVERSE, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::REVERSE_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
#endif
sep = new QAction(this);
sep->setSeparator(true);
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep.Break"), globalcontext);
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.snapshotAction,
Constants::SNAPSHOT, debuggercontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::SNAPSHOT_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(theDebuggerAction(OperateByInstruction),
Constants::OPERATE_BY_INSTRUCTION, debuggercontext);
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
cmd = am->registerAction(actions.breakAction,
Constants::TOGGLE_BREAK, cppeditorcontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::TOGGLE_BREAK_KEY));
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);
//mcppcontext->addAction(cmd);
sep = new QAction(this);
sep->setSeparator(true);
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep.Watch"), globalcontext);
mdebug->addAction(cmd);
m_uiSwitcher->addMenuAction(cmd);