forked from qt-creator/qt-creator
debugger: re-enable "data drill down on mouse hover"
This commit is contained in:
@@ -41,6 +41,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxUseToolTipsInMainEditor">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use tooltips in main editor while debugging</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBoxSkipKnownFrames">
|
<widget class="QCheckBox" name="checkBoxSkipKnownFrames">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|||||||
@@ -442,27 +442,20 @@ void DebuggerManager::init()
|
|||||||
registerView->setModel(d->m_registerHandler->model());
|
registerView->setModel(d->m_registerHandler->model());
|
||||||
|
|
||||||
// Locals
|
// Locals
|
||||||
d->m_watchHandler = new WatchHandler;
|
d->m_watchHandler = new WatchHandler(this);
|
||||||
QTreeView *localsView = qobject_cast<QTreeView *>(d->m_localsWindow);
|
QTreeView *localsView = qobject_cast<QTreeView *>(d->m_localsWindow);
|
||||||
localsView->setModel(d->m_watchHandler->model(LocalsWatch));
|
localsView->setModel(d->m_watchHandler->model(LocalsWatch));
|
||||||
|
|
||||||
// Watchers
|
// Watchers
|
||||||
QTreeView *watchersView = qobject_cast<QTreeView *>(d->m_watchersWindow);
|
QTreeView *watchersView = qobject_cast<QTreeView *>(d->m_watchersWindow);
|
||||||
watchersView->setModel(d->m_watchHandler->model(WatchersWatch));
|
watchersView->setModel(d->m_watchHandler->model(WatchersWatch));
|
||||||
connect(d->m_watchHandler, SIGNAL(sessionValueRequested(QString,QVariant*)),
|
|
||||||
this, SIGNAL(sessionValueRequested(QString,QVariant*)));
|
|
||||||
connect(d->m_watchHandler, SIGNAL(setSessionValueRequested(QString,QVariant)),
|
|
||||||
this, SIGNAL(setSessionValueRequested(QString,QVariant)));
|
|
||||||
connect(theDebuggerAction(AssignValue), SIGNAL(triggered()),
|
connect(theDebuggerAction(AssignValue), SIGNAL(triggered()),
|
||||||
this, SLOT(assignValueInDebugger()), Qt::QueuedConnection);
|
this, SLOT(assignValueInDebugger()), Qt::QueuedConnection);
|
||||||
|
|
||||||
// Tooltip
|
// Tooltip
|
||||||
//QTreeView *tooltipView = qobject_cast<QTreeView *>(d->m_tooltipWindow);
|
//QTreeView *tooltipView = qobject_cast<QTreeView *>(d->m_tooltipWindow);
|
||||||
//tooltipView->setModel(d->m_watchHandler->model(TooltipsWatch));
|
//tooltipView->setModel(d->m_watchHandler->model(TooltipsWatch));
|
||||||
//qRegisterMetaType<WatchData>("WatchData");
|
|
||||||
qRegisterMetaType<WatchData>("WatchData");
|
qRegisterMetaType<WatchData>("WatchData");
|
||||||
connect(d->m_watchHandler, SIGNAL(watchDataUpdateNeeded(Debugger::Internal::WatchData)),
|
|
||||||
this, SLOT(updateWatchData(Debugger::Internal::WatchData)));
|
|
||||||
|
|
||||||
d->m_actions.continueAction = new QAction(tr("Continue"), this);
|
d->m_actions.continueAction = new QAction(tr("Continue"), this);
|
||||||
d->m_actions.continueAction->setIcon(QIcon(":/debugger/images/debugger_continue_small.png"));
|
d->m_actions.continueAction->setIcon(QIcon(":/debugger/images/debugger_continue_small.png"));
|
||||||
|
|||||||
@@ -293,7 +293,8 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
|
|||||||
m_ui.checkBoxUseMessageBoxForSignals);
|
m_ui.checkBoxUseMessageBoxForSignals);
|
||||||
m_group.insert(theDebuggerAction(SkipKnownFrames),
|
m_group.insert(theDebuggerAction(SkipKnownFrames),
|
||||||
m_ui.checkBoxSkipKnownFrames);
|
m_ui.checkBoxSkipKnownFrames);
|
||||||
m_group.insert(theDebuggerAction(UseToolTipsInMainEditor), 0);
|
m_group.insert(theDebuggerAction(UseToolTipsInMainEditor),
|
||||||
|
m_ui.checkBoxUseToolTipsInMainEditor);
|
||||||
m_group.insert(theDebuggerAction(UseToolTipsInLocalsView), 0);
|
m_group.insert(theDebuggerAction(UseToolTipsInLocalsView), 0);
|
||||||
m_group.insert(theDebuggerAction(UseToolTipsInBreakpointsView), 0);
|
m_group.insert(theDebuggerAction(UseToolTipsInBreakpointsView), 0);
|
||||||
m_group.insert(theDebuggerAction(UseAddressInBreakpointsView), 0);
|
m_group.insert(theDebuggerAction(UseAddressInBreakpointsView), 0);
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ Q_SLOT void ToolTipWidget::computeSize()
|
|||||||
setMinimumSize(m_size);
|
setMinimumSize(m_size);
|
||||||
setMaximumSize(m_size);
|
setMaximumSize(m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolTipWidget::done()
|
void ToolTipWidget::done()
|
||||||
{
|
{
|
||||||
qApp->removeEventFilter(this);
|
qApp->removeEventFilter(this);
|
||||||
|
|||||||
@@ -737,12 +737,10 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
|
|||||||
if (cmd.flags & RebuildModel) {
|
if (cmd.flags & RebuildModel) {
|
||||||
++m_pendingRequests;
|
++m_pendingRequests;
|
||||||
PENDING_DEBUG(" CALLBACK" << cmd.callbackName
|
PENDING_DEBUG(" CALLBACK" << cmd.callbackName
|
||||||
<< "INCREMENTS PENDING TO:" << m_pendingRequests << cmd.command
|
<< "INCREMENTS PENDING TO:" << m_pendingRequests << cmd.command);
|
||||||
<< m_gdbAdapter->state());
|
|
||||||
} else {
|
} else {
|
||||||
PENDING_DEBUG(" UNKNOWN CALLBACK" << cmd.callbackName
|
PENDING_DEBUG(" UNKNOWN CALLBACK" << cmd.callbackName
|
||||||
<< "LEAVES PENDING AT:" << m_pendingRequests << cmd.command
|
<< "LEAVES PENDING AT:" << m_pendingRequests << cmd.command);
|
||||||
<< m_gdbAdapter->state());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd.flags & NeedsStop) {
|
if (cmd.flags & NeedsStop) {
|
||||||
@@ -2512,7 +2510,6 @@ bool GdbEngine::showToolTip()
|
|||||||
WatchHandler *handler = manager()->watchHandler();
|
WatchHandler *handler = manager()->watchHandler();
|
||||||
WatchModel *model = handler->model(TooltipsWatch);
|
WatchModel *model = handler->model(TooltipsWatch);
|
||||||
QString iname = tooltipINameForExpression(m_toolTipExpression);
|
QString iname = tooltipINameForExpression(m_toolTipExpression);
|
||||||
model->setActiveData(iname);
|
|
||||||
WatchItem *item = model->findItem(iname, model->rootItem());
|
WatchItem *item = model->findItem(iname, model->rootItem());
|
||||||
if (!item) {
|
if (!item) {
|
||||||
hideDebuggerToolTip();
|
hideDebuggerToolTip();
|
||||||
@@ -2745,7 +2742,7 @@ void GdbEngine::runDebuggingHelper(const WatchData &data0, bool dumpChildren)
|
|||||||
}
|
}
|
||||||
WatchData data = data0;
|
WatchData data = data0;
|
||||||
|
|
||||||
// Avoid endless loops created by faulty dumpers
|
// Avoid endless loops created by faulty dumpers.
|
||||||
QString processedName = QString(_("%1-%2").arg(dumpChildren).arg(data.iname));
|
QString processedName = QString(_("%1-%2").arg(dumpChildren).arg(data.iname));
|
||||||
if (m_processedNames.contains(processedName)) {
|
if (m_processedNames.contains(processedName)) {
|
||||||
emit gdbInputAvailable(LogStatus,
|
emit gdbInputAvailable(LogStatus,
|
||||||
@@ -2971,6 +2968,7 @@ void GdbEngine::updateWatchData(const WatchData &data)
|
|||||||
// Bump requests to avoid model rebuilding during the nested
|
// Bump requests to avoid model rebuilding during the nested
|
||||||
// updateWatchModel runs.
|
// updateWatchModel runs.
|
||||||
++m_pendingRequests;
|
++m_pendingRequests;
|
||||||
|
PENDING_DEBUG("UPDATE WATCH BUMPS PENDING UP TO " << m_pendingRequests);
|
||||||
#if 1
|
#if 1
|
||||||
QMetaObject::invokeMethod(this, "updateWatchDataHelper",
|
QMetaObject::invokeMethod(this, "updateWatchDataHelper",
|
||||||
Qt::QueuedConnection, Q_ARG(WatchData, data));
|
Qt::QueuedConnection, Q_ARG(WatchData, data));
|
||||||
@@ -2992,6 +2990,7 @@ void GdbEngine::updateWatchDataHelper(const WatchData &data)
|
|||||||
updateSubItem(data);
|
updateSubItem(data);
|
||||||
//PENDING_DEBUG("INTERNAL TRIGGERING UPDATE WATCH MODEL");
|
//PENDING_DEBUG("INTERNAL TRIGGERING UPDATE WATCH MODEL");
|
||||||
--m_pendingRequests;
|
--m_pendingRequests;
|
||||||
|
PENDING_DEBUG("UPDATE WATCH DONE BUMPS PENDING DOWN TO " << m_pendingRequests);
|
||||||
if (m_pendingRequests <= 0)
|
if (m_pendingRequests <= 0)
|
||||||
rebuildModel();
|
rebuildModel();
|
||||||
}
|
}
|
||||||
@@ -3512,7 +3511,7 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals)
|
|||||||
|
|
||||||
void GdbEngine::insertData(const WatchData &data0)
|
void GdbEngine::insertData(const WatchData &data0)
|
||||||
{
|
{
|
||||||
//qDebug() << "INSERT DATA" << data0.toString();
|
PENDING_DEBUG("INSERT DATA" << data0.toString());
|
||||||
WatchData data = data0;
|
WatchData data = data0;
|
||||||
if (data.value.startsWith(__("mi_cmd_var_create:"))) {
|
if (data.value.startsWith(__("mi_cmd_var_create:"))) {
|
||||||
qDebug() << "BOGUS VALUE:" << data.toString();
|
qDebug() << "BOGUS VALUE:" << data.toString();
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "watchhandler.h"
|
#include "watchhandler.h"
|
||||||
#include "watchutils.h"
|
#include "watchutils.h"
|
||||||
#include "debuggeractions.h"
|
#include "debuggeractions.h"
|
||||||
|
#include "debuggermanager.h"
|
||||||
|
|
||||||
#if USE_MODEL_TEST
|
#if USE_MODEL_TEST
|
||||||
#include "modeltest.h"
|
#include "modeltest.h"
|
||||||
@@ -589,8 +590,10 @@ void WatchModel::fetchMore(const QModelIndex &index)
|
|||||||
if (WatchItem *item = watchItem(index)) {
|
if (WatchItem *item = watchItem(index)) {
|
||||||
item->fetchTriggered = true;
|
item->fetchTriggered = true;
|
||||||
WatchData data = *item;
|
WatchData data = *item;
|
||||||
|
if (item->children.isEmpty()) {
|
||||||
data.setChildrenNeeded();
|
data.setChildrenNeeded();
|
||||||
emit m_handler->watchDataUpdateNeeded(data);
|
m_handler->m_manager->updateWatchData(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,7 +906,7 @@ void WatchModel::insertData(const WatchData &data)
|
|||||||
|
|
||||||
void WatchModel::insertBulkData(const QList<WatchData> &list)
|
void WatchModel::insertBulkData(const QList<WatchData> &list)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 0
|
||||||
for (int i = 0; i != list.size(); ++i)
|
for (int i = 0; i != list.size(); ++i)
|
||||||
insertData(list.at(i));
|
insertData(list.at(i));
|
||||||
return;
|
return;
|
||||||
@@ -1037,8 +1040,9 @@ QDebug operator<<(QDebug d, const WatchModel &m)
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
WatchHandler::WatchHandler()
|
WatchHandler::WatchHandler(DebuggerManager *manager)
|
||||||
{
|
{
|
||||||
|
m_manager = manager;
|
||||||
m_expandPointers = true;
|
m_expandPointers = true;
|
||||||
m_inChange = false;
|
m_inChange = false;
|
||||||
|
|
||||||
@@ -1089,7 +1093,7 @@ void WatchHandler::insertData(const WatchData &data)
|
|||||||
MODEL_DEBUG("INSERTDATA: " << data.toString());
|
MODEL_DEBUG("INSERTDATA: " << data.toString());
|
||||||
QTC_ASSERT(data.isValid(), return);
|
QTC_ASSERT(data.isValid(), return);
|
||||||
if (data.isSomethingNeeded()) {
|
if (data.isSomethingNeeded()) {
|
||||||
emit watchDataUpdateNeeded(data);
|
m_manager->updateWatchData(data);
|
||||||
} else {
|
} else {
|
||||||
WatchModel *model = modelForIName(data.iname);
|
WatchModel *model = modelForIName(data.iname);
|
||||||
QTC_ASSERT(model, return);
|
QTC_ASSERT(model, return);
|
||||||
@@ -1097,10 +1101,10 @@ void WatchHandler::insertData(const WatchData &data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// bulk-insertion
|
// Bulk-insertion
|
||||||
void WatchHandler::insertBulkData(const QList<WatchData> &list)
|
void WatchHandler::insertBulkData(const QList<WatchData> &list)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
foreach (const WatchItem &data, list)
|
foreach (const WatchItem &data, list)
|
||||||
insertData(data);
|
insertData(data);
|
||||||
return;
|
return;
|
||||||
@@ -1123,7 +1127,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
|
|||||||
|
|
||||||
foreach (const WatchData &data, list) {
|
foreach (const WatchData &data, list) {
|
||||||
if (data.isSomethingNeeded())
|
if (data.isSomethingNeeded())
|
||||||
emit watchDataUpdateNeeded(data);
|
m_manager->updateWatchData(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1160,7 +1164,6 @@ void WatchHandler::watchExpression(const QString &exp)
|
|||||||
data.iname = watcherName(exp);
|
data.iname = watcherName(exp);
|
||||||
insertData(data);
|
insertData(data);
|
||||||
saveWatchers();
|
saveWatchers();
|
||||||
//emit watchModelUpdateRequested();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::setDisplayedIName(const QString &iname, bool on)
|
void WatchHandler::setDisplayedIName(const QString &iname, bool on)
|
||||||
@@ -1273,8 +1276,7 @@ void WatchHandler::updateWatchers()
|
|||||||
|
|
||||||
void WatchHandler::loadWatchers()
|
void WatchHandler::loadWatchers()
|
||||||
{
|
{
|
||||||
QVariant value;
|
QVariant value = m_manager->sessionValue("Watchers");
|
||||||
sessionValueRequested("Watchers", &value);
|
|
||||||
foreach (const QString &exp, value.toStringList())
|
foreach (const QString &exp, value.toStringList())
|
||||||
m_watcherNames[exp] = watcherCounter++;
|
m_watcherNames[exp] = watcherCounter++;
|
||||||
|
|
||||||
@@ -1294,13 +1296,12 @@ void WatchHandler::saveWatchers()
|
|||||||
if (!watcherName.isEmpty() && watcherName != watcherEditPlaceHolder())
|
if (!watcherName.isEmpty() && watcherName != watcherEditPlaceHolder())
|
||||||
watcherNames.push_back(watcherName);
|
watcherNames.push_back(watcherName);
|
||||||
}
|
}
|
||||||
setSessionValueRequested("Watchers", QVariant(watcherNames));
|
m_manager->setSessionValue("Watchers", QVariant(watcherNames));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::loadTypeFormats()
|
void WatchHandler::loadTypeFormats()
|
||||||
{
|
{
|
||||||
QVariant value;
|
QVariant value = m_manager->sessionValue("DefaultFormats");
|
||||||
sessionValueRequested("DefaultFormats", &value);
|
|
||||||
QMap<QString, QVariant> typeFormats = value.toMap();
|
QMap<QString, QVariant> typeFormats = value.toMap();
|
||||||
QMapIterator<QString, QVariant> it(typeFormats);
|
QMapIterator<QString, QVariant> it(typeFormats);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@@ -1320,7 +1321,7 @@ void WatchHandler::saveTypeFormats()
|
|||||||
if (!key.isEmpty())
|
if (!key.isEmpty())
|
||||||
typeFormats.insert(key, it.value());
|
typeFormats.insert(key, it.value());
|
||||||
}
|
}
|
||||||
setSessionValueRequested("DefaultFormats", QVariant(typeFormats));
|
m_manager->setSessionValue("DefaultFormats", QVariant(typeFormats));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::saveSessionData()
|
void WatchHandler::saveSessionData()
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ class QDebug;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|
||||||
|
class DebuggerManager;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class WatchItem;
|
class WatchItem;
|
||||||
@@ -203,7 +206,6 @@ private:
|
|||||||
void removeOutdatedHelper(WatchItem *item);
|
void removeOutdatedHelper(WatchItem *item);
|
||||||
WatchItem *rootItem() const;
|
WatchItem *rootItem() const;
|
||||||
void removeItem(WatchItem *item);
|
void removeItem(WatchItem *item);
|
||||||
void setActiveData(const QString &data) { m_activeData = data; }
|
|
||||||
|
|
||||||
void emitDataChanged(int column,
|
void emitDataChanged(int column,
|
||||||
const QModelIndex &parentIndex = QModelIndex());
|
const QModelIndex &parentIndex = QModelIndex());
|
||||||
@@ -221,7 +223,6 @@ private:
|
|||||||
WatchHandler *m_handler;
|
WatchHandler *m_handler;
|
||||||
WatchType m_type;
|
WatchType m_type;
|
||||||
WatchItem *m_root;
|
WatchItem *m_root;
|
||||||
QString m_activeData;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class WatchHandler : public QObject
|
class WatchHandler : public QObject
|
||||||
@@ -229,7 +230,7 @@ class WatchHandler : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WatchHandler();
|
explicit WatchHandler(DebuggerManager *manager);
|
||||||
WatchModel *model(WatchType type) const;
|
WatchModel *model(WatchType type) const;
|
||||||
WatchModel *modelForIName(const QString &data) const;
|
WatchModel *modelForIName(const QString &data) const;
|
||||||
|
|
||||||
@@ -261,11 +262,6 @@ public:
|
|||||||
|
|
||||||
static QString watcherEditPlaceHolder();
|
static QString watcherEditPlaceHolder();
|
||||||
|
|
||||||
signals:
|
|
||||||
void watchDataUpdateNeeded(const Debugger::Internal::WatchData &data);
|
|
||||||
void sessionValueRequested(const QString &name, QVariant *value);
|
|
||||||
void setSessionValueRequested(const QString &name, const QVariant &value);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class WatchModel;
|
friend class WatchModel;
|
||||||
|
|
||||||
@@ -294,6 +290,7 @@ private:
|
|||||||
WatchModel *m_locals;
|
WatchModel *m_locals;
|
||||||
WatchModel *m_watchers;
|
WatchModel *m_watchers;
|
||||||
WatchModel *m_tooltips;
|
WatchModel *m_tooltips;
|
||||||
|
DebuggerManager *m_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user