forked from qt-creator/qt-creator
debugger: start action handling refactoring
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "breakwindow.h"
|
#include "breakwindow.h"
|
||||||
|
|
||||||
|
#include "debuggeractions.h"
|
||||||
#include "ui_breakcondition.h"
|
#include "ui_breakcondition.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -93,7 +94,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
QAction *act3 = new QAction("Edit condition...", &menu);
|
QAction *act3 = new QAction("Edit condition...", &menu);
|
||||||
act0->setEnabled(index.isValid());
|
act0->setEnabled(index.isValid());
|
||||||
QAction *act4 = new QAction("Syncronize breakpoints", &menu);
|
QAction *act4 = new QAction("Syncronize breakpoints", &menu);
|
||||||
QAction *act5 = new QAction("Debugger properties...", &menu);
|
QAction *act5 = action(SettingsDialog);
|
||||||
|
|
||||||
menu.addAction(act0);
|
menu.addAction(act0);
|
||||||
menu.addAction(act3);
|
menu.addAction(act3);
|
||||||
@@ -116,7 +117,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
else if (act == act4)
|
else if (act == act4)
|
||||||
emit breakpointSynchronizationRequested();
|
emit breakpointSynchronizationRequested();
|
||||||
else if (act == act5)
|
else if (act == act5)
|
||||||
emit settingsDialogRequested();
|
act->trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakWindow::deleteBreakpoint(const QModelIndex &idx)
|
void BreakWindow::deleteBreakpoint(const QModelIndex &idx)
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ signals:
|
|||||||
void breakpointDeleted(int index);
|
void breakpointDeleted(int index);
|
||||||
void breakpointActivated(int index);
|
void breakpointActivated(int index);
|
||||||
void breakpointSynchronizationRequested();
|
void breakpointSynchronizationRequested();
|
||||||
void settingsDialogRequested();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void rowActivated(const QModelIndex &index);
|
void rowActivated(const QModelIndex &index);
|
||||||
|
|||||||
@@ -987,15 +987,6 @@ void CdbDebugEnginePrivate::handleBreakpointEvent(PDEBUG_BREAKPOINT pBP)
|
|||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbDebugEngine::setDebugDumpers(bool on)
|
|
||||||
{
|
|
||||||
Q_UNUSED(on)
|
|
||||||
}
|
|
||||||
|
|
||||||
void CdbDebugEngine::recheckCustomDumperAvailability()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CdbDebugEngine::reloadSourceFiles()
|
void CdbDebugEngine::reloadSourceFiles()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,10 +89,6 @@ public:
|
|||||||
virtual void loadAllSymbols();
|
virtual void loadAllSymbols();
|
||||||
|
|
||||||
virtual void reloadRegisters();
|
virtual void reloadRegisters();
|
||||||
|
|
||||||
virtual void setDebugDumpers(bool on);
|
|
||||||
virtual void recheckCustomDumperAvailability();
|
|
||||||
|
|
||||||
virtual void reloadSourceFiles();
|
virtual void reloadSourceFiles();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -239,8 +239,6 @@ void DebuggerManager::init()
|
|||||||
m_breakHandler, SLOT(activateBreakpoint(int)));
|
m_breakHandler, SLOT(activateBreakpoint(int)));
|
||||||
connect(breakView, SIGNAL(breakpointDeleted(int)),
|
connect(breakView, SIGNAL(breakpointDeleted(int)),
|
||||||
m_breakHandler, SLOT(removeBreakpoint(int)));
|
m_breakHandler, SLOT(removeBreakpoint(int)));
|
||||||
connect(breakView, SIGNAL(settingsDialogRequested()),
|
|
||||||
this, SIGNAL(settingsDialogRequested()));
|
|
||||||
connect(breakView, SIGNAL(breakpointSynchronizationRequested()),
|
connect(breakView, SIGNAL(breakpointSynchronizationRequested()),
|
||||||
this, SLOT(attemptBreakpointSynchronization()));
|
this, SLOT(attemptBreakpointSynchronization()));
|
||||||
connect(m_breakHandler, SIGNAL(gotoLocation(QString,int,bool)),
|
connect(m_breakHandler, SIGNAL(gotoLocation(QString,int,bool)),
|
||||||
@@ -295,10 +293,6 @@ void DebuggerManager::init()
|
|||||||
this, SLOT(assignValueInDebugger(QString,QString)));
|
this, SLOT(assignValueInDebugger(QString,QString)));
|
||||||
connect(localsView, SIGNAL(requestWatchExpression(QString)),
|
connect(localsView, SIGNAL(requestWatchExpression(QString)),
|
||||||
this, SLOT(watchExpression(QString)));
|
this, SLOT(watchExpression(QString)));
|
||||||
connect(localsView, SIGNAL(settingsDialogRequested()),
|
|
||||||
this, SIGNAL(settingsDialogRequested()));
|
|
||||||
connect(localsView, SIGNAL(requestRecheckCustomDumperAvailability()),
|
|
||||||
this, SLOT(recheckCustomDumperAvailability()));
|
|
||||||
|
|
||||||
// Watchers
|
// Watchers
|
||||||
QTreeView *watchersView = qobject_cast<QTreeView *>(m_watchersWindow);
|
QTreeView *watchersView = qobject_cast<QTreeView *>(m_watchersWindow);
|
||||||
@@ -317,10 +311,6 @@ void DebuggerManager::init()
|
|||||||
this, SIGNAL(sessionValueRequested(QString,QVariant*)));
|
this, SIGNAL(sessionValueRequested(QString,QVariant*)));
|
||||||
connect(m_watchHandler, SIGNAL(setSessionValueRequested(QString,QVariant)),
|
connect(m_watchHandler, SIGNAL(setSessionValueRequested(QString,QVariant)),
|
||||||
this, SIGNAL(setSessionValueRequested(QString,QVariant)));
|
this, SIGNAL(setSessionValueRequested(QString,QVariant)));
|
||||||
connect(watchersView, SIGNAL(settingsDialogRequested()),
|
|
||||||
this, SIGNAL(settingsDialogRequested()));
|
|
||||||
connect(watchersView, SIGNAL(requestRecheckCustomDumperAvailability()),
|
|
||||||
this, SLOT(recheckCustomDumperAvailability()));
|
|
||||||
|
|
||||||
// Tooltip
|
// Tooltip
|
||||||
QTreeView *tooltipView = qobject_cast<QTreeView *>(m_tooltipWindow);
|
QTreeView *tooltipView = qobject_cast<QTreeView *>(m_tooltipWindow);
|
||||||
@@ -480,6 +470,8 @@ void DebuggerManager::init()
|
|||||||
|
|
||||||
connect(action(UseDumpers), SIGNAL(triggered(bool)),
|
connect(action(UseDumpers), SIGNAL(triggered(bool)),
|
||||||
this, SLOT(setUseDumpers(bool)));
|
this, SLOT(setUseDumpers(bool)));
|
||||||
|
connect(action(DebugDumpers), SIGNAL(triggered(bool)),
|
||||||
|
this, SLOT(setDebugDumpers(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerManager::setDebuggerType(DebuggerType type)
|
void DebuggerManager::setDebuggerType(DebuggerType type)
|
||||||
@@ -1311,7 +1303,6 @@ void DebuggerManager::setDebugDumpers(bool on)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(m_engine, return);
|
QTC_ASSERT(m_engine, return);
|
||||||
m_settings.m_debugDumpers = on;
|
m_settings.m_debugDumpers = on;
|
||||||
m_engine->setDebugDumpers(on);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerManager::setSkipKnownFrames(bool on)
|
void DebuggerManager::setSkipKnownFrames(bool on)
|
||||||
@@ -1424,17 +1415,6 @@ void DebuggerManager::fileOpen(const QString &fileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Watch specific stuff
|
|
||||||
//
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void DebuggerManager::recheckCustomDumperAvailability()
|
|
||||||
{
|
|
||||||
m_engine->recheckCustomDumperAvailability();
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Disassembler specific stuff
|
// Disassembler specific stuff
|
||||||
|
|||||||
@@ -284,10 +284,10 @@ public slots:
|
|||||||
|
|
||||||
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
|
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
|
||||||
|
|
||||||
void setDebugDumpers(bool on);
|
|
||||||
void setSkipKnownFrames(bool on);
|
void setSkipKnownFrames(bool on);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void setDebugDumpers(bool on);
|
||||||
void setUseDumpers(bool on);
|
void setUseDumpers(bool on);
|
||||||
void showDebuggerOutput(const QString &prefix, const QString &msg);
|
void showDebuggerOutput(const QString &prefix, const QString &msg);
|
||||||
void showDebuggerInput(const QString &prefix, const QString &msg);
|
void showDebuggerInput(const QString &prefix, const QString &msg);
|
||||||
@@ -309,7 +309,6 @@ private slots:
|
|||||||
void setStatus(int status);
|
void setStatus(int status);
|
||||||
void clearStatusMessage();
|
void clearStatusMessage();
|
||||||
void attemptBreakpointSynchronization();
|
void attemptBreakpointSynchronization();
|
||||||
void recheckCustomDumperAvailability();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
|
|||||||
m_ui.checkBoxListSourceFiles->setChecked(m_settings.m_listSourceFiles);
|
m_ui.checkBoxListSourceFiles->setChecked(m_settings.m_listSourceFiles);
|
||||||
m_ui.checkBoxSkipKnownFrames->setChecked(m_settings.m_skipKnownFrames);
|
m_ui.checkBoxSkipKnownFrames->setChecked(m_settings.m_skipKnownFrames);
|
||||||
m_ui.checkBoxDebugDumpers->setChecked(m_settings.m_debugDumpers);
|
m_ui.checkBoxDebugDumpers->setChecked(m_settings.m_debugDumpers);
|
||||||
m_ui.checkBoxUseCustomDumpers->setChecked(m_settings.m_useDumpers);
|
m_ui.checkBoxUseDumpers->setChecked(m_settings.m_useDumpers);
|
||||||
m_ui.checkBoxUseToolTips->setChecked(m_settings.m_useToolTips);
|
m_ui.checkBoxUseToolTips->setChecked(m_settings.m_useToolTips);
|
||||||
|
|
||||||
connect(m_ui.radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
|
connect(m_ui.radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
|
||||||
@@ -310,8 +310,8 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
|
|||||||
//m_dumpLogAction = new QAction(this);
|
//m_dumpLogAction = new QAction(this);
|
||||||
//m_dumpLogAction->setText(tr("Dump Log File for Debugging Purposes"));
|
//m_dumpLogAction->setText(tr("Dump Log File for Debugging Purposes"));
|
||||||
//
|
//
|
||||||
connect(m_ui.checkBoxUseCustomDumpers, SIGNAL(clicked(bool)),
|
connect(m_ui.checkBoxUseDumpers, SIGNAL(clicked()),
|
||||||
action(UseDumpers), SLOT(trigger(bool)));
|
action(UseDumpers), SLOT(trigger()));
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ void GdbOptionPage::apply()
|
|||||||
m_settings.m_skipKnownFrames = m_ui.checkBoxSkipKnownFrames->isChecked();
|
m_settings.m_skipKnownFrames = m_ui.checkBoxSkipKnownFrames->isChecked();
|
||||||
m_settings.m_listSourceFiles = m_ui.checkBoxListSourceFiles->isChecked();
|
m_settings.m_listSourceFiles = m_ui.checkBoxListSourceFiles->isChecked();
|
||||||
m_settings.m_debugDumpers = m_ui.checkBoxDebugDumpers->isChecked();
|
m_settings.m_debugDumpers = m_ui.checkBoxDebugDumpers->isChecked();
|
||||||
m_settings.m_useDumpers = m_ui.checkBoxUseCustomDumpers->isChecked();
|
m_settings.m_useDumpers = m_ui.checkBoxUseDumpers->isChecked();
|
||||||
m_settings.m_useToolTips = m_ui.checkBoxUseToolTips->isChecked();
|
m_settings.m_useToolTips = m_ui.checkBoxUseToolTips->isChecked();
|
||||||
|
|
||||||
m_settings.m_pluginAllBreakpoints =
|
m_settings.m_pluginAllBreakpoints =
|
||||||
|
|||||||
@@ -287,6 +287,10 @@ void GdbEngine::initializeConnections()
|
|||||||
|
|
||||||
connect(action(UseDumpers), SIGNAL(triggered(bool)),
|
connect(action(UseDumpers), SIGNAL(triggered(bool)),
|
||||||
this, SLOT(setUseDumpers(bool)));
|
this, SLOT(setUseDumpers(bool)));
|
||||||
|
connect(action(DebugDumpers), SIGNAL(triggered(bool)),
|
||||||
|
this, SLOT(setDebugDumpers(bool)));
|
||||||
|
connect(action(RecheckDumpers), SIGNAL(triggered()),
|
||||||
|
this, SLOT(recheckCustomDumperAvailability()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::initializeVariables()
|
void GdbEngine::initializeVariables()
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ private:
|
|||||||
void loadSymbols(const QString &moduleName);
|
void loadSymbols(const QString &moduleName);
|
||||||
void loadAllSymbols();
|
void loadAllSymbols();
|
||||||
|
|
||||||
void setDebugDumpers(bool on);
|
Q_SLOT void setDebugDumpers(bool on);
|
||||||
Q_SLOT void setUseDumpers(bool on);
|
Q_SLOT void setUseDumpers(bool on);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="checkBoxUseCustomDumpers">
|
<widget class="QCheckBox" name="checkBoxUseDumpers">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Checking this will make the debugger try to use code to format certain data (QObject, QString, std::string etc.) nicely.</string>
|
<string>Checking this will make the debugger try to use code to format certain data (QObject, QString, std::string etc.) nicely.</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -81,8 +81,6 @@ public:
|
|||||||
virtual void loadAllSymbols() = 0;
|
virtual void loadAllSymbols() = 0;
|
||||||
|
|
||||||
virtual void reloadRegisters() = 0;
|
virtual void reloadRegisters() = 0;
|
||||||
virtual void setDebugDumpers(bool on) = 0;
|
|
||||||
virtual void recheckCustomDumperAvailability() = 0;
|
|
||||||
|
|
||||||
virtual void reloadSourceFiles() = 0;
|
virtual void reloadSourceFiles() = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -97,9 +97,6 @@ private:
|
|||||||
void loadSessionData() {}
|
void loadSessionData() {}
|
||||||
void saveSessionData() {}
|
void saveSessionData() {}
|
||||||
|
|
||||||
void setDebugDumpers(bool) {}
|
|
||||||
void recheckCustomDumperAvailability() {}
|
|
||||||
|
|
||||||
void assignValueInDebugger(const QString &expr, const QString &value);
|
void assignValueInDebugger(const QString &expr, const QString &value);
|
||||||
void executeDebuggerCommand(const QString & command);
|
void executeDebuggerCommand(const QString & command);
|
||||||
|
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
QAction *act3 = 0;
|
QAction *act3 = 0;
|
||||||
QAction *act4 = 0;
|
QAction *act4 = 0;
|
||||||
QAction *act5 = new QAction("Debugger properties...", &menu);
|
QAction *act5 = action(RecheckDumpers);
|
||||||
QAction *act6 = new QAction("Re-check availability of custom dumpers", &menu);
|
QAction *act6 = action(UseDumpers);
|
||||||
QAction *act7 = action(UseDumpers);
|
QAction *act7 = action(SettingsDialog);
|
||||||
|
|
||||||
menu.addAction(act1);
|
menu.addAction(act1);
|
||||||
menu.addAction(act2);
|
menu.addAction(act2);
|
||||||
@@ -134,9 +134,10 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
// FIXME: menu.addAction(act4);
|
// FIXME: menu.addAction(act4);
|
||||||
}
|
}
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(act6);
|
|
||||||
menu.addAction(act7);
|
|
||||||
menu.addAction(act5);
|
menu.addAction(act5);
|
||||||
|
menu.addAction(act6);
|
||||||
|
menu.addSeparator();
|
||||||
|
menu.addAction(act7);
|
||||||
|
|
||||||
QAction *act = menu.exec(ev->globalPos());
|
QAction *act = menu.exec(ev->globalPos());
|
||||||
|
|
||||||
@@ -153,10 +154,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
emit requestRemoveWatchExpression(exp);
|
emit requestRemoveWatchExpression(exp);
|
||||||
else if (act == act4)
|
else if (act == act4)
|
||||||
model()->setData(mi0, !visual, VisualRole);
|
model()->setData(mi0, !visual, VisualRole);
|
||||||
else if (act == act5)
|
else
|
||||||
emit settingsDialogRequested();
|
act->trigger();
|
||||||
else if (act == act6)
|
|
||||||
emit requestRecheckCustomDumperAvailability();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchWindow::resizeColumnsToContents()
|
void WatchWindow::resizeColumnsToContents()
|
||||||
|
|||||||
@@ -63,8 +63,6 @@ signals:
|
|||||||
void requestAssignValue(const QString &exp, const QString &value);
|
void requestAssignValue(const QString &exp, const QString &value);
|
||||||
void requestExpandChildren(const QModelIndex &idx);
|
void requestExpandChildren(const QModelIndex &idx);
|
||||||
void requestCollapseChildren(const QModelIndex &idx);
|
void requestCollapseChildren(const QModelIndex &idx);
|
||||||
void requestRecheckCustomDumperAvailability();
|
|
||||||
void settingsDialogRequested();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleChangedItem(QWidget *);
|
void handleChangedItem(QWidget *);
|
||||||
|
|||||||
Reference in New Issue
Block a user