QmlDebugger: keeping watches when changing stack frames

Reviewed-by: Kai Koehne
This commit is contained in:
Christiaan Janssen
2011-04-20 16:47:47 +02:00
parent 01ad08400e
commit 85801227a9
2 changed files with 28 additions and 3 deletions

View File

@@ -949,14 +949,29 @@ void QmlEngine::messageReceived(const QByteArray &message)
sendPing();
} else if (command == "LOCALS") {
QList<WatchData> locals;
QList<WatchData> watches;
int frameId;
stream >> frameId >> locals;
if (!stream.atEnd()) { // compatibility with jsdebuggeragent from 2.1, 2.2
stream >> watches;
}
logMessage(LogReceive, QString("%1 %2 (%3 x locals)").arg(
logMessage(LogReceive, QString("%1 %2 (%3 x locals) (%4 x watchdata)").arg(
QString(command), QString::number(frameId),
QString::number(locals.size())));
QString::number(locals.size()),
QString::number(watches.size())));
watchHandler()->beginCycle();
bool needPing = false;
foreach (WatchData data, watches) {
data.iname = watchHandler()->watcherName(data.exp);
watchHandler()->insertData(data);
if (watchHandler()->expandedINames().contains(data.iname)) {
needPing = true;
expandObject(data.iname, data.id);
}
}
foreach (WatchData data, locals) {
data.iname = "local." + data.exp;
watchHandler()->insertData(data);