Commit bb3e6b72 authored by hjk's avatar hjk

debugger: rename data dumpers into "debugging helpers"

parent 14eb3f6f
......@@ -161,35 +161,35 @@ DebuggerSettings *theDebuggerSettings()
item->setText(QObject::tr("Collapse item"));
//
// Dumpers
// DebuggingHelper
//
item = new SavedAction(instance);
instance->insertItem(UseDumpers, item);
instance->insertItem(UseDebuggingHelpers, item);
item->setDefaultValue(true);
item->setSettingsKey("DebugMode", "UseDumpers");
item->setSettingsKey("DebugMode", "UseDebuggingHelpers");
item->setText(QObject::tr("Use data dumpers"));
item->setCheckable(true);
item->setDefaultValue(true);
item = new SavedAction(instance);
instance->insertItem(UseCustomDumperLocation, item);
item->setSettingsKey("DebugMode", "CustomDumperLocation");
instance->insertItem(UseCustomDebuggingHelperLocation, item);
item->setSettingsKey("DebugMode", "CustomDebuggingHelperLocation");
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(CustomDumperLocation, item);
item->setSettingsKey("DebugMode", "CustomDumperLocation");
instance->insertItem(CustomDebuggingHelperLocation, item);
item->setSettingsKey("DebugMode", "CustomDebuggingHelperLocation");
item = new SavedAction(instance);
instance->insertItem(DebugDumpers, item);
item->setSettingsKey("DebugMode", "DebugDumpers");
instance->insertItem(DebugDebuggingHelpers, item);
item->setSettingsKey("DebugMode", "DebugDebuggingHelpers");
item->setText(QObject::tr("Debug data dumpers"));
item->setCheckable(true);
item = new SavedAction(instance);
item->setText(QObject::tr("Recheck custom dumper availability"));
instance->insertItem(RecheckDumpers, item);
instance->insertItem(RecheckDebuggingHelpers, item);
//
// Breakpoints
......
......@@ -92,11 +92,11 @@ enum DebuggerActionCode
ExpandItem,
CollapseItem,
RecheckDumpers,
UseDumpers,
UseCustomDumperLocation,
CustomDumperLocation,
DebugDumpers,
RecheckDebuggingHelpers,
UseDebuggingHelpers,
UseCustomDebuggingHelperLocation,
CustomDebuggingHelperLocation,
DebugDebuggingHelpers,
// Source List
ListSourceFiles,
......
......@@ -321,23 +321,23 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
///////////////////////////////////////////////////////////////////////
//
// DumperOptionPage
// DebuggingHelperOptionPage
//
///////////////////////////////////////////////////////////////////////
namespace Debugger {
namespace Internal {
class DumperOptionPage : public Core::IOptionsPage
class DebuggingHelperOptionPage : public Core::IOptionsPage
{
Q_OBJECT
public:
DumperOptionPage() {}
DebuggingHelperOptionPage() {}
// IOptionsPage
QString id() const { return QLatin1String("DataDumper"); }
QString trName() const { return tr("Data Dumper"); }
QString id() const { return QLatin1String("DebuggingHelper"); }
QString trName() const { return tr("Debugging Helper"); }
QString category() const { return QLatin1String("Debugger"); }
QString trCategory() const { return tr("Debugger"); }
......@@ -349,39 +349,39 @@ private:
Q_SLOT void updateState();
friend class DebuggerPlugin;
Ui::DumperOptionPage m_ui;
Ui::DebuggingHelperOptionPage m_ui;
Core::Utils::SavedActionSet m_group;
};
QWidget *DumperOptionPage::createPage(QWidget *parent)
QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
{
QWidget *w = new QWidget(parent);
m_ui.setupUi(w);
m_ui.dumperLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
m_ui.dumperLocationChooser->setPromptDialogTitle(tr("Choose Dumper Location"));
m_ui.dumperLocationChooser->setPromptDialogTitle(tr("Choose DebuggingHelper Location"));
m_ui.dumperLocationChooser->setInitialBrowsePathBackup(
Core::ICore::instance()->resourcePath() + "../../lib");
connect(m_ui.checkBoxUseDumpers, SIGNAL(toggled(bool)),
connect(m_ui.checkBoxUseDebuggingHelpers, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
connect(m_ui.checkBoxUseCustomDumperLocation, SIGNAL(toggled(bool)),
connect(m_ui.checkBoxUseCustomDebuggingHelperLocation, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
m_group.clear();
m_group.insert(theDebuggerAction(UseDumpers),
m_ui.checkBoxUseDumpers);
m_group.insert(theDebuggerAction(UseCustomDumperLocation),
m_ui.checkBoxUseCustomDumperLocation);
m_group.insert(theDebuggerAction(CustomDumperLocation),
m_group.insert(theDebuggerAction(UseDebuggingHelpers),
m_ui.checkBoxUseDebuggingHelpers);
m_group.insert(theDebuggerAction(UseCustomDebuggingHelperLocation),
m_ui.checkBoxUseCustomDebuggingHelperLocation);
m_group.insert(theDebuggerAction(CustomDebuggingHelperLocation),
m_ui.dumperLocationChooser);
m_group.insert(theDebuggerAction(DebugDumpers),
m_ui.checkBoxDebugDumpers);
m_group.insert(theDebuggerAction(DebugDebuggingHelpers),
m_ui.checkBoxDebugDebuggingHelpers);
m_ui.dumperLocationChooser->
setEnabled(theDebuggerAction(UseCustomDumperLocation)->value().toBool());
setEnabled(theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool());
#ifndef QT_DEBUG
#if 0
......@@ -396,13 +396,13 @@ QWidget *DumperOptionPage::createPage(QWidget *parent)
return w;
}
void DumperOptionPage::updateState()
void DebuggingHelperOptionPage::updateState()
{
m_ui.checkBoxUseCustomDumperLocation->setEnabled(
m_ui.checkBoxUseDumpers->isChecked());
m_ui.checkBoxUseCustomDebuggingHelperLocation->setEnabled(
m_ui.checkBoxUseDebuggingHelpers->isChecked());
m_ui.dumperLocationChooser->setEnabled(
m_ui.checkBoxUseDumpers->isChecked()
&& m_ui.checkBoxUseCustomDumperLocation->isChecked());
m_ui.checkBoxUseDebuggingHelpers->isChecked()
&& m_ui.checkBoxUseCustomDebuggingHelperLocation->isChecked());
}
} // namespace Internal
......@@ -652,7 +652,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
// FIXME:
m_generalOptionPage = new GdbOptionPage;
addObject(m_generalOptionPage);
m_dumperOptionPage = new DumperOptionPage;
m_dumperOptionPage = new DebuggingHelperOptionPage;
addObject(m_dumperOptionPage);
m_locationMark = 0;
......
......@@ -57,7 +57,7 @@ namespace Internal {
class DebuggerManager;
class DebugMode;
class GdbOptionPage;
class DumperOptionPage;
class DebuggingHelperOptionPage;
class LocationMark;
class DebuggerPlugin : public ExtensionSystem::IPlugin
......@@ -102,14 +102,14 @@ private:
friend class DebuggerManager;
friend class GdbOptionPage;
friend class DumperOptionPage;
friend class DebuggingHelperOptionPage;
friend class DebugMode; // FIXME: Just a hack now so that it can access the views
DebuggerManager *m_manager;
DebugMode *m_debugMode;
GdbOptionPage *m_generalOptionPage;
DumperOptionPage *m_dumperOptionPage;
DebuggingHelperOptionPage *m_dumperOptionPage;
QString m_previousMode;
LocationMark *m_locationMark;
......
TEMPLATE = lib
TARGET = Dumper
TARGET = DebuggingHelper
CONFIG += shared
DESTDIR = ../../../bin
include(../../qworkbenchlibrary.pri)
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DumperOptionPage</class>
<widget class="QWidget" name="DumperOptionPage">
<class>DebuggingHelperOptionPage</class>
<widget class="QWidget" name="DebuggingHelperOptionPage">
<property name="geometry">
<rect>
<x>0</x>
......@@ -15,7 +15,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxUseDumpers">
<widget class="QCheckBox" name="checkBoxUseDebuggingHelpers">
<property name="toolTip">
<string>This will enable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</string>
</property>
......@@ -43,7 +43,7 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseCustomDumperLocation">
<widget class="QCheckBox" name="checkBoxUseCustomDebuggingHelperLocation">
<property name="toolTip">
<string>This will load a dumper library</string>
</property>
......@@ -73,7 +73,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="labelDumperLocation">
<widget class="QLabel" name="labelDebuggingHelperLocation">
<property name="text">
<string>Location: </string>
</property>
......@@ -85,9 +85,9 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDebugDumpers">
<widget class="QCheckBox" name="checkBoxDebugDebuggingHelpers">
<property name="toolTip">
<string notr="true">This is an internal tool to make debugging the Custom Data Dumper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
<string notr="true">This is an internal tool to make debugging the debugging helper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
</property>
<property name="text">
<string>Debug custom dumpers</string>
......@@ -108,13 +108,13 @@
</spacer>
</item>
</layout>
<zorder>checkBoxDebugDumpers</zorder>
<zorder>checkBoxUseDumpers</zorder>
<zorder>checkBoxUseDefaultDumperLocation</zorder>
<zorder>checkBoxDebugDebuggingHelpers</zorder>
<zorder>checkBoxUseDebuggingHelpers</zorder>
<zorder>checkBoxUseDefaultDebuggingHelperLocation</zorder>
<zorder>horizontalSpacer</zorder>
<zorder>labelDumperLocation</zorder>
<zorder>labelDebuggingHelperLocation</zorder>
<zorder>horizontalSpacer_2</zorder>
<zorder>labelDumperLocation</zorder>
<zorder>labelDebuggingHelperLocation</zorder>
</widget>
<customwidgets>
<customwidget>
......
This diff is collapsed.
......@@ -72,12 +72,12 @@ struct GdbCookie
QVariant cookie;
};
enum DataDumperState
enum DebuggingHelperState
{
DataDumperUninitialized,
DataDumperLoadTried,
DataDumperAvailable,
DataDumperUnavailable,
DebuggingHelperUninitialized,
DebuggingHelperLoadTried,
DebuggingHelperAvailable,
DebuggingHelperUnavailable,
};
......@@ -130,8 +130,8 @@ private:
void loadSymbols(const QString &moduleName);
void loadAllSymbols();
Q_SLOT void setDebugDumpers(const QVariant &on);
Q_SLOT void setUseDumpers(const QVariant &on);
Q_SLOT void setDebugDebuggingHelpers(const QVariant &on);
Q_SLOT void setUseDebuggingHelpers(const QVariant &on);
//
// Own stuff
......@@ -306,11 +306,11 @@ private:
void handleTypeContents(const QString &output);
void maybeHandleInferiorPidChanged(const QString &pid);
void tryLoadCustomDumpers();
Q_SLOT void recheckCustomDumperAvailability();
void runCustomDumper(const WatchData &data, bool dumpChildren);
void runDirectDumper(const WatchData &data, bool dumpChildren);
bool isCustomValueDumperAvailable(const QString &type) const;
void tryLoadDebuggingHelpers();
Q_SLOT void recheckDebuggingHelperAvailability();
void runDebuggingHelper(const WatchData &data, bool dumpChildren);
void runDirectDebuggingHelper(const WatchData &data, bool dumpChildren);
bool hasDebuggingHelperForType(const QString &type) const;
void handleVarListChildren(const GdbResultRecord &record,
const WatchData &cookie);
......@@ -321,15 +321,15 @@ private:
const WatchData &cookie);
void handleToolTip(const GdbResultRecord &record,
const QString &cookie);
void handleQueryDataDumper(const GdbResultRecord &record);
void handleDumpCustomValue1(const GdbResultRecord &record,
void handleQueryDebuggingHelper(const GdbResultRecord &record);
void handleDebuggingHelperValue1(const GdbResultRecord &record,
const WatchData &cookie);
void handleDumpCustomValue2(const GdbResultRecord &record,
void handleDebuggingHelperValue2(const GdbResultRecord &record,
const WatchData &cookie);
void handleDumpCustomValue3(const GdbResultRecord &record,
void handleDebuggingHelperValue3(const GdbResultRecord &record,
const WatchData &cookie);
void handleDumpCustomEditValue(const GdbResultRecord &record);
void handleDumpCustomSetup(const GdbResultRecord &record);
void handleDebuggingHelperEditValue(const GdbResultRecord &record);
void handleDebuggingHelperSetup(const GdbResultRecord &record);
void handleStackListLocals(const GdbResultRecord &record);
void handleStackListArguments(const GdbResultRecord &record);
void handleVarListChildrenHelper(const GdbMi &child,
......@@ -340,11 +340,11 @@ private:
QString m_editedData;
int m_pendingRequests;
QStringList m_availableSimpleDumpers;
QStringList m_availableSimpleDebuggingHelpers;
QString m_namespace; // namespace used in "namespaced Qt";
int m_qtVersion; // Qt version used in the debugged program
DataDumperState m_dataDumperState; // state of qt creator dumpers
DebuggingHelperState m_debuggingHelperState;
QList<GdbMi> m_currentFunctionArgs;
QString m_currentFrame;
QMap<QString, QString> m_varToType;
......
......@@ -240,7 +240,55 @@ void ScriptEngine::continueInferior()
void ScriptEngine::runInferior()
{
//QDir dir(QApplication::applicationDirPath());
//if (dir.dirName() == QLatin1String("debug") || dir.dirName() == QLatin1String("release"))
// dir.cdUp();
//dir.cdUp();
//dir.cdUp();
QDir dir("/home/apoenitz/dev/qtscriptgenerator");
if (!dir.cd("plugins")) {
fprintf(stderr, "plugins folder does not exist -- did you build the bindings?\n");
return;
}
QStringList paths = qApp->libraryPaths();
paths << dir.absolutePath();
qApp->setLibraryPaths(paths);
SDEBUG("ScriptEngine::runInferior()");
QStringList extensions;
extensions << "qt.core"
<< "qt.gui"
<< "qt.xml"
<< "qt.svg"
<< "qt.network"
<< "qt.sql"
<< "qt.opengl"
<< "qt.webkit"
<< "qt.xmlpatterns"
<< "qt.uitools";
QStringList failExtensions;
foreach (const QString &ext, extensions) {
QScriptValue ret = m_scriptEngine->importExtension(ext);
if (ret.isError())
failExtensions.append(ext);
}
if (!failExtensions.isEmpty()) {
if (failExtensions.size() == extensions.size()) {
qWarning("Failed to import Qt bindings!\n"
"Plugins directory searched: %s/script\n"
"Make sure that the bindings have been built, "
"and that this executable and the plugins are "
"using compatible Qt libraries.", qPrintable(dir.absolutePath()));
} else {
qWarning("Failed to import some Qt bindings: %s\n"
"Plugins directory searched: %s/script\n"
"Make sure that the bindings have been built, "
"and that this executable and the plugins are "
"using compatible Qt libraries.",
qPrintable(failExtensions.join(", ")), qPrintable(dir.absolutePath()));
}
}
QScriptValue result = m_scriptEngine->evaluate(m_scriptContents, m_scriptFileName);
}
......
......@@ -183,7 +183,7 @@ QList<StackFrame> StackHandler::frames() const
return m_stackFrames;
}
bool StackHandler::isDebuggingDumpers() const
bool StackHandler::isDebuggingDebuggingHelpers() const
{
for (int i = m_stackFrames.size(); --i >= 0; )
if (m_stackFrames.at(i).function.startsWith("qDumpObjectData"))
......
......@@ -74,7 +74,7 @@ public:
// Called from StackHandler after a new stack list has been received
void removeAll();
QAbstractItemModel *stackModel() { return this; }
bool isDebuggingDumpers() const;
bool isDebuggingDebuggingHelpers() const;
private:
// QAbstractTableModel
......
......@@ -189,8 +189,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(act3);
menu.addSeparator();
menu.addAction(theDebuggerAction(RecheckDumpers));
menu.addAction(theDebuggerAction(UseDumpers));
menu.addAction(theDebuggerAction(RecheckDebuggingHelpers));
menu.addAction(theDebuggerAction(UseDebuggingHelpers));
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
......
......@@ -30,6 +30,8 @@
function cube(a)
{
var x = a * a * a;
x = x + 1;
x = x - 1;
return x;
}
......
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