aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-08-25 17:32:14 +0200
committercon <qtc-committer@nokia.com>2009-08-25 17:40:31 +0200
commit7265a2e875df3e88da192b93171f44e52aa6de54 (patch)
tree8da7e73451e5615e76ccb56f9099f47c1622a38d
parentb78f34fea18a19e58940d5061317775aed945d28 (diff)
debugger: partial revert of 894febba to fix QStringList display
There was a case where "childtype" had to be used instead of "type". (cherry picked from commit 9af1a0a79348c750e72120eb791cde78c0dccd78)
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp32
-rw-r--r--src/plugins/debugger/gdb/gdbengine.h1
2 files changed, 19 insertions, 14 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 2dc8dd5cc7..9c4f7dda85 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -3144,6 +3144,7 @@ void GdbEngine::updateWatchData(const WatchData &data)
void GdbEngine::rebuildModel()
{
+ m_processedNames.clear();
PENDING_DEBUG("REBUILDING MODEL");
emit gdbInputAvailable(LogStatus, _("<Rebuild Watchmodel>"));
q->showStatusMessage(tr("Finished retrieving data."), 400);
@@ -3267,20 +3268,22 @@ void GdbEngine::handleVarAssign(const GdbResultRecord &, const QVariant &)
}
// Find the "type" and "displayedtype" children of root and set up type.
-void GdbEngine::setWatchDataType(WatchData &data, const GdbMi &root)
+void GdbEngine::setWatchDataType(WatchData &data, const GdbMi &item)
{
- const GdbMi &typeItem = root.findChild("type");
- if (typeItem.isValid()) {
- const QString miData = _(typeItem.data());
+ if (item.isValid()) {
+ const QString miData = _(item.data());
if (!data.framekey.isEmpty())
m_varToType[data.framekey] = miData;
data.setType(miData);
} else if (data.type.isEmpty()) {
data.setTypeNeeded();
}
- const GdbMi &displayedTypeItem = root.findChild("displayedtype");
- if (displayedTypeItem.isValid())
- data.displayedType = _(displayedTypeItem.data());
+}
+
+void GdbEngine::setWatchDataDisplayedType(WatchData &data, const GdbMi &item)
+{
+ if (item.isValid())
+ data.displayedType = _(item.data());
}
void GdbEngine::handleVarCreate(const GdbResultRecord &record,
@@ -3293,7 +3296,7 @@ void GdbEngine::handleVarCreate(const GdbResultRecord &record,
//qDebug() << "HANDLE VARIABLE CREATION:" << data.toString();
if (record.resultClass == GdbResultDone) {
data.variable = data.iname;
- setWatchDataType(data, record.data);
+ setWatchDataType(data, record.data.findChild("type"));
if (hasDebuggingHelperForType(data.type)) {
// we do not trust gdb if we have a custom dumper
if (record.data.findChild("children").isValid())
@@ -3395,7 +3398,8 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record,
return;
}
- setWatchDataType(data, contents);
+ setWatchDataType(data, record.data.findChild("type"));
+ setWatchDataDisplayedType(data, record.data.findChild("displaytype"));
setWatchDataValue(data, contents.findChild("value"),
contents.findChild("valueencoded").data().toInt());
setWatchDataAddress(data, contents.findChild("addr"));
@@ -3421,7 +3425,7 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record,
// try not to repeat data too often
WatchData childtemplate;
- setWatchDataType(childtemplate, contents);
+ setWatchDataType(childtemplate, contents.findChild("childtype"));
setWatchDataChildCount(childtemplate, contents.findChild("childnumchild"));
//qDebug() << "DATA:" << data.toString();
@@ -3449,7 +3453,7 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record,
//data1.name += " (" + skey + ")";
data1.name = skey;
}
- setWatchDataType(data1, item);
+ setWatchDataType(data1, item.findChild("type"));
setWatchDataExpression(data1, item.findChild("exp"));
setWatchDataChildCount(data1, item.findChild("numchild"));
setWatchDataValue(data1, item.findChild("value"),
@@ -3652,7 +3656,7 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals)
data.name = nam;
data.exp = nam;
data.framekey = m_currentFrame + data.name;
- setWatchDataType(data, item);
+ setWatchDataType(data, item.findChild("type"));
// set value only directly if it is simple enough, otherwise
// pass through the insertData() machinery
if (isIntOrFloatType(data.type) || isPointerType(data.type))
@@ -3709,7 +3713,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
data.name = _(exp);
data.iname = parent.iname + _c('.') + data.name;
data.variable = _(name);
- setWatchDataType(data, item);
+ setWatchDataType(data, item.findChild("type"));
setWatchDataValue(data, item.findChild("value"));
setWatchDataAddress(data, item.findChild("addr"));
setWatchDataSAddress(data, item.findChild("saddr"));
@@ -3731,7 +3735,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
WatchData data;
data.iname = parent.iname + _c('.') + __(exp);
data.variable = _(name);
- setWatchDataType(data, item);
+ setWatchDataType(data, item.findChild("type"));
setWatchDataValue(data, item.findChild("value"));
setWatchDataAddress(data, item.findChild("addr"));
setWatchDataSAddress(data, item.findChild("saddr"));
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index 405951e61a..820515df6b 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -368,6 +368,7 @@ private:
void handleVarListChildrenHelper(const GdbMi &child,
const WatchData &parent);
void setWatchDataType(WatchData &data, const GdbMi &mi);
+ void setWatchDataDisplayedType(WatchData &data, const GdbMi &mi);
void setLocals(const QList<GdbMi> &locals);
bool startModeAllowsDumpers() const;