debugger: small changes for synchroneous mode

This commit is contained in:
hjk
2009-10-20 16:02:35 +02:00
parent 7961e885af
commit 902bb6baa0
3 changed files with 20 additions and 14 deletions

View File

@@ -1166,7 +1166,7 @@ void GdbEngine::handleStop1(const GdbMi &data)
reloadSourceFiles(); reloadSourceFiles();
postCommand(_("-break-list"), CB(handleBreakList)); postCommand(_("-break-list"), CB(handleBreakList));
QVariant var = QVariant::fromValue<GdbMi>(data); QVariant var = QVariant::fromValue<GdbMi>(data);
postCommand(_("p 0"), CB(handleStop2), var); // dummy postCommand(_("p 2"), CB(handleStop2), var); // dummy
} else { } else {
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
// For some reason, attaching to a stopped process causes *two* stops // For some reason, attaching to a stopped process causes *two* stops
@@ -2992,7 +2992,7 @@ void GdbEngine::updateWatchData(const WatchData &data)
if (isSynchroneous()) { if (isSynchroneous()) {
// This should only be called for fresh expanded items, not for // This should only be called for fresh expanded items, not for
// items that had their children retrieved earlier. // items that had their children retrieved earlier.
qDebug() << "\nUPDATE WATCH DATA: " << data.toString() << "\n"; //qDebug() << "\nUPDATE WATCH DATA: " << data.toString() << "\n";
#if 0 #if 0
WatchData data1 = data; WatchData data1 = data;
data1.setAllUnneeded(); data1.setAllUnneeded();
@@ -3234,7 +3234,7 @@ void GdbEngine::handleDebuggingHelperValue1(const GdbResponse &response)
&& msg.startsWith(__("The program being debugged stopped while")) && msg.startsWith(__("The program being debugged stopped while"))
&& msg.contains(__("qDumpObjectData440"))) { && msg.contains(__("qDumpObjectData440"))) {
// Fake full stop // Fake full stop
postCommand(_("p 0"), CB(handleStop2)); // dummy postCommand(_("p 3"), CB(handleStop2)); // dummy
return; return;
} }
#endif #endif
@@ -3426,8 +3426,8 @@ void GdbEngine::updateLocals(const QVariant &cookie)
postCommand(_("bb %1 %2") postCommand(_("bb %1 %2")
.arg(int(theDebuggerBoolSetting(UseDebuggingHelpers))) .arg(int(theDebuggerBoolSetting(UseDebuggingHelpers)))
.arg(expanded.join(_(","))), .arg(expanded.join(_(","))),
WatchUpdate, CB(handleStackFrame1)); CB(handleStackFrame1));
postCommand(_("p 0"), WatchUpdate, CB(handleStackFrame2)); postCommand(_("p 1"), CB(handleStackFrame2));
} else { } else {
QString level = QString::number(currentFrame()); QString level = QString::number(currentFrame());
// '2' is 'list with type and value' // '2' is 'list with type and value'
@@ -3483,7 +3483,9 @@ void GdbEngine::handleStackFrame2(const GdbResponse &response)
// qDebug() << "READ: " << list.at(i).toString(); // qDebug() << "READ: " << list.at(i).toString();
manager()->watchHandler()->insertBulkData(list); manager()->watchHandler()->insertBulkData(list);
manager()->watchHandler()->updateWatchers(); // FIXME:
//manager()->watchHandler()->updateWatchers();
rebuildModel();
} else { } else {
QTC_ASSERT(false, /**/); QTC_ASSERT(false, /**/);
} }
@@ -3563,7 +3565,7 @@ WatchData GdbEngine::localVariable(const GdbMi &item,
{ {
// Local variables of inlined code are reported as // Local variables of inlined code are reported as
// 26^done,locals={varobj={exp="this",value="",name="var4",exp="this", // 26^done,locals={varobj={exp="this",value="",name="var4",exp="this",
// numchild="1",type="const QtSharedPointer::Basic<CPlusPlus::..." // numchild="1",type="const QtSharedPointer::Basic<CPlusPlus::..."}}
// We do not want these at all. Current hypotheses is that those // We do not want these at all. Current hypotheses is that those
// "spurious" locals have _two_ "exp" field. Try to filter them: // "spurious" locals have _two_ "exp" field. Try to filter them:
#ifdef Q_OS_MAC #ifdef Q_OS_MAC

View File

@@ -608,9 +608,10 @@ void WatchModel::fetchMore(const QModelIndex &index)
QTC_ASSERT(index.isValid(), return); QTC_ASSERT(index.isValid(), return);
QTC_ASSERT(!watchItem(index)->fetchTriggered, return); QTC_ASSERT(!watchItem(index)->fetchTriggered, return);
if (WatchItem *item = watchItem(index)) { if (WatchItem *item = watchItem(index)) {
m_handler->m_expandedINames.insert(item->iname);
item->fetchTriggered = true; item->fetchTriggered = true;
WatchData data = *item;
if (item->children.isEmpty()) { if (item->children.isEmpty()) {
WatchData data = *item;
data.setChildrenNeeded(); data.setChildrenNeeded();
m_handler->m_manager->updateWatchData(data); m_handler->m_manager->updateWatchData(data);
} }
@@ -789,10 +790,13 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro
{ {
WatchItem &data = *watchItem(index); WatchItem &data = *watchItem(index);
if (role == ExpandedRole) { if (role == ExpandedRole) {
if (value.toBool()) if (value.toBool()) {
// Should already have been triggered by fetchMore()
QTC_ASSERT(m_handler->m_expandedINames.contains(data.iname), /**/);
m_handler->m_expandedINames.insert(data.iname); m_handler->m_expandedINames.insert(data.iname);
else } else {
m_handler->m_expandedINames.remove(data.iname); m_handler->m_expandedINames.remove(data.iname);
}
} else if (role == TypeFormatRole) { } else if (role == TypeFormatRole) {
m_handler->setFormat(data.type, value.toInt()); m_handler->setFormat(data.type, value.toInt());
} else if (role == IndividualFormatRole) { } else if (role == IndividualFormatRole) {

View File

@@ -136,10 +136,10 @@ WatchWindow::WatchWindow(Type type, DebuggerManager *manager, QWidget *parent)
connect(act, SIGNAL(toggled(bool)), connect(act, SIGNAL(toggled(bool)),
this, SLOT(setAlternatingRowColorsHelper(bool))); this, SLOT(setAlternatingRowColorsHelper(bool)));
connect(this, SIGNAL(expanded(QModelIndex)), connect(this, SIGNAL(expanded(QModelIndex)),
this, SLOT(expandNode(QModelIndex))); this, SLOT(expandNode(QModelIndex)));
connect(this, SIGNAL(collapsed(QModelIndex)), connect(this, SIGNAL(collapsed(QModelIndex)),
this, SLOT(collapseNode(QModelIndex))); this, SLOT(collapseNode(QModelIndex)));
} }
void WatchWindow::expandNode(const QModelIndex &idx) void WatchWindow::expandNode(const QModelIndex &idx)