Commit cc89dcc7 authored by hjk's avatar hjk

debugger: make "Use Dumpers" a pool action

parent 04a15daa
......@@ -992,11 +992,6 @@ void CdbDebugEngine::setDebugDumpers(bool on)
Q_UNUSED(on)
}
void CdbDebugEngine::setUseCustomDumpers(bool on)
{
Q_UNUSED(on)
}
void CdbDebugEngine::recheckCustomDumperAvailability()
{
}
......
......@@ -91,7 +91,6 @@ public:
virtual void reloadRegisters();
virtual void setDebugDumpers(bool on);
virtual void setUseCustomDumpers(bool on);
virtual void recheckCustomDumperAvailability();
virtual void reloadSourceFiles();
......
......@@ -17,6 +17,7 @@ QT += gui network script
HEADERS += \
breakhandler.h \
breakwindow.h \
debuggeractions.h \
debuggerconstants.h \
debuggerdialogs.h \
debuggermanager.h \
......@@ -47,6 +48,7 @@ SOURCES += \
breakhandler.cpp \
breakwindow.cpp \
breakwindow.h \
debuggeractions.cpp \
debuggerdialogs.cpp \
debuggermanager.cpp \
debuggeroutputwindow.cpp \
......
......@@ -29,6 +29,7 @@
#include "debuggermanager.h"
#include "debuggeractions.h"
#include "debuggerconstants.h"
#include "idebuggerengine.h"
......@@ -94,7 +95,7 @@ DebuggerSettings::DebuggerSettings()
m_skipKnownFrames = false;
m_debugDumpers = false;
m_useToolTips = false;
m_useCustomDumpers = true;
m_useDumpers = true;
m_listSourceFiles = false;
}
......@@ -108,7 +109,7 @@ QString DebuggerSettings::dump()
<< " gdbEnv: " << m_gdbEnv
<< " autoRun: " << m_autoRun
<< " autoQuit: " << m_autoQuit
<< " useCustomDumpers: " << m_useCustomDumpers
<< " useCustomDumpers: " << m_useDumpers
<< " skipKnownFrames: " << m_skipKnownFrames
<< " debugDumpers: " << m_debugDumpers
<< " useToolTips: " << m_useToolTips
......@@ -476,6 +477,9 @@ void DebuggerManager::init()
setDebuggerType(GdbDebugger);
if (Debugger::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << gdbEngine << winEngine << scriptEngine;
connect(action(UseDumpers), SIGNAL(triggered(bool)),
this, SLOT(setUseDumpers(bool)));
}
void DebuggerManager::setDebuggerType(DebuggerType type)
......@@ -1292,16 +1296,15 @@ bool DebuggerManager::debugDumpers() const
return m_settings.m_debugDumpers;
}
bool DebuggerManager::useCustomDumpers() const
bool DebuggerManager::useDumpers() const
{
return m_settings.m_useCustomDumpers;
return m_settings.m_useDumpers;
}
void DebuggerManager::setUseCustomDumpers(bool on)
void DebuggerManager::setUseDumpers(bool on)
{
QTC_ASSERT(m_engine, return);
m_settings.m_useCustomDumpers = on;
m_engine->setUseCustomDumpers(on);
m_settings.m_useDumpers = on;
}
void DebuggerManager::setDebugDumpers(bool on)
......
......@@ -162,7 +162,7 @@ private:
virtual void showApplicationOutput(const QString &data) = 0;
virtual bool skipKnownFrames() const = 0;
virtual bool debugDumpers() const = 0;
virtual bool useCustomDumpers() const = 0;
virtual bool useDumpers() const = 0;
virtual bool wantsSourceFileList() const = 0;
virtual bool wantsAllPluginBreakpoints() const = 0;
......@@ -193,7 +193,7 @@ public:
bool m_autoRun;
bool m_autoQuit;
bool m_useCustomDumpers;
bool m_useDumpers;
bool m_skipKnownFrames;
bool m_debugDumpers;
bool m_useToolTips;
......@@ -284,11 +284,11 @@ public slots:
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
void setUseCustomDumpers(bool on);
void setDebugDumpers(bool on);
void setSkipKnownFrames(bool on);
private slots:
void setUseDumpers(bool on);
void showDebuggerOutput(const QString &prefix, const QString &msg);
void showDebuggerInput(const QString &prefix, const QString &msg);
void showApplicationOutput(const QString &data);
......@@ -326,7 +326,7 @@ private:
bool skipKnownFrames() const;
bool debugDumpers() const;
bool useCustomDumpers() const;
bool useDumpers() const;
bool wantsSourceFileList() const
{ return m_settings.m_listSourceFiles; }
bool wantsAllPluginBreakpoints() const
......
......@@ -29,6 +29,7 @@
#include "debuggerplugin.h"
#include "debuggeractions.h"
#include "debuggerconstants.h"
#include "debuggermanager.h"
#include "debuggerrunner.h"
......@@ -286,7 +287,7 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
m_ui.checkBoxListSourceFiles->setChecked(m_settings.m_listSourceFiles);
m_ui.checkBoxSkipKnownFrames->setChecked(m_settings.m_skipKnownFrames);
m_ui.checkBoxDebugDumpers->setChecked(m_settings.m_debugDumpers);
m_ui.checkBoxUseCustomDumpers->setChecked(m_settings.m_useCustomDumpers);
m_ui.checkBoxUseCustomDumpers->setChecked(m_settings.m_useDumpers);
m_ui.checkBoxUseToolTips->setChecked(m_settings.m_useToolTips);
connect(m_ui.radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
......@@ -310,7 +311,7 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
//m_dumpLogAction->setText(tr("Dump Log File for Debugging Purposes"));
//
connect(m_ui.checkBoxUseCustomDumpers, SIGNAL(clicked(bool)),
m_plugin->m_manager, SLOT(setUseCustomDumpers(bool)));
action(UseDumpers), SLOT(trigger(bool)));
return w;
}
......@@ -324,7 +325,7 @@ void GdbOptionPage::apply()
m_settings.m_skipKnownFrames = m_ui.checkBoxSkipKnownFrames->isChecked();
m_settings.m_listSourceFiles = m_ui.checkBoxListSourceFiles->isChecked();
m_settings.m_debugDumpers = m_ui.checkBoxDebugDumpers->isChecked();
m_settings.m_useCustomDumpers = m_ui.checkBoxUseCustomDumpers->isChecked();
m_settings.m_useDumpers = m_ui.checkBoxUseCustomDumpers->isChecked();
m_settings.m_useToolTips = m_ui.checkBoxUseToolTips->isChecked();
m_settings.m_pluginAllBreakpoints =
......@@ -908,7 +909,7 @@ void DebuggerPlugin::writeSettings() const
s->setValue("AutoQuit", m->m_autoQuit);
s->setValue("UseToolTips", m->m_useToolTips);
s->setValue("UseCustomDumpers", m->m_useCustomDumpers);
s->setValue("UseCustomDumpers", m->m_useDumpers);
s->setValue("ListSourceFiles", m->m_listSourceFiles);
s->setValue("SkipKnowFrames", m->m_skipKnownFrames);
s->setValue("DebugDumpers", m->m_debugDumpers);
......@@ -946,7 +947,7 @@ void DebuggerPlugin::readSettings()
m->m_skipKnownFrames = s->value("SkipKnownFrames", false).toBool();
m->m_debugDumpers = s->value("DebugDumpers", false).toBool();
m->m_useCustomDumpers = s->value("UseCustomDumpers", true).toBool();
m->m_useDumpers = s->value("UseCustomDumpers", true).toBool();
m->m_useToolTips = s->value("UseToolTips", false).toBool();
m->m_listSourceFiles = s->value("ListSourceFiles", false).toBool();
......
......@@ -29,6 +29,7 @@
#include "gdbengine.h"
#include "debuggeractions.h"
#include "debuggerconstants.h"
#include "debuggermanager.h"
#include "gdbmi.h"
......@@ -283,6 +284,9 @@ void GdbEngine::initializeConnections()
connect(this, SIGNAL(applicationOutputAvailable(QString)),
q, SLOT(showApplicationOutput(QString)),
Qt::QueuedConnection);
connect(action(UseDumpers), SIGNAL(triggered(bool)),
this, SLOT(setUseDumpers(bool)));
}
void GdbEngine::initializeVariables()
......@@ -3073,9 +3077,9 @@ static QString sizeofTypeExpression(const QString &type)
return "sizeof(" + gdbQuoteTypes(type) + ")";
}
void GdbEngine::setUseCustomDumpers(bool on)
void GdbEngine::setUseDumpers(bool on)
{
//qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on;
qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on;
Q_UNUSED(on);
// FIXME: a bit too harsh, but otherwise the treeview sometimes look funny
//m_expandedINames.clear();
......@@ -3086,7 +3090,7 @@ void GdbEngine::setUseCustomDumpers(bool on)
bool GdbEngine::isCustomValueDumperAvailable(const QString &type) const
{
DebuggerSettings *s = q->settings();
if (!s->m_useCustomDumpers)
if (!s->m_useDumpers)
return false;
if (q->startMode() == AttachCore) {
......
......@@ -131,7 +131,7 @@ private:
void loadAllSymbols();
void setDebugDumpers(bool on);
void setUseCustomDumpers(bool on);
Q_SLOT void setUseDumpers(bool on);
//
// Own stuff
......
......@@ -82,7 +82,6 @@ public:
virtual void reloadRegisters() = 0;
virtual void setDebugDumpers(bool on) = 0;
virtual void setUseCustomDumpers(bool on) = 0;
virtual void recheckCustomDumperAvailability() = 0;
virtual void reloadSourceFiles() = 0;
......
......@@ -98,7 +98,6 @@ private:
void saveSessionData() {}
void setDebugDumpers(bool) {}
void setUseCustomDumpers(bool) {}
void recheckCustomDumperAvailability() {}
void assignValueInDebugger(const QString &expr, const QString &value);
......
......@@ -29,6 +29,8 @@
#include "watchwindow.h"
#include "debuggeractions.h"
#include <QtCore/QDebug>
#include <QtCore/QTimer>
......@@ -106,6 +108,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *act4 = 0;
QAction *act5 = new QAction("Debugger properties...", &menu);
QAction *act6 = new QAction("Re-check availability of custom dumpers", &menu);
QAction *act7 = action(UseDumpers);
menu.addAction(act1);
menu.addAction(act2);
......@@ -132,6 +135,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
}
menu.addSeparator();
menu.addAction(act6);
menu.addAction(act7);
menu.addAction(act5);
QAction *act = menu.exec(ev->globalPos());
......
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