diff options
author | hjk <qthjk@ovi.com> | 2012-05-18 02:28:41 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-05-24 14:33:34 +0200 |
commit | e11a3a7697e7b432ac061277694885cf3724f25c (patch) | |
tree | 46a3140ed47b072782541d005d0edbdf1259a554 /src/plugins/debugger/gdb/pythongdbengine.cpp | |
parent | c14c1248ed01f5e16975dc1082b5ce4e58052f8b (diff) | |
download | qt-creator-e11a3a7697e7b432ac061277694885cf3724f25c.tar.gz |
debugger: rework WatchModel
It's one model for all locals, watch, return, tooltip and inspector
data. This allows more streamlined code paths and better isolation
of the model data from the WatchHandler. WatchItems are now registered
in a hash indexed by iname, so inames can be used as the primary
handle to watch data in the WatchHandler interface.
Change-Id: Idac0a808b5d785307496d1de4198a1f2e9ce3880
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src/plugins/debugger/gdb/pythongdbengine.cpp')
-rw-r--r-- | src/plugins/debugger/gdb/pythongdbengine.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/plugins/debugger/gdb/pythongdbengine.cpp b/src/plugins/debugger/gdb/pythongdbengine.cpp index f69ee66055..b020cc03b0 100644 --- a/src/plugins/debugger/gdb/pythongdbengine.cpp +++ b/src/plugins/debugger/gdb/pythongdbengine.cpp @@ -54,12 +54,11 @@ namespace Internal { void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) { PRECONDITION; - m_pendingWatchRequests = 0; + //m_pendingWatchRequests = 0; m_pendingBreakpointRequests = 0; m_processedNames.clear(); - WatchHandler *handler = watchHandler(); - handler->beginCycle(!params.tryPartial); + WatchHandler *handler = watchHandler(); QByteArray expanded = "expanded:" + handler->expansionRequests() + ' '; expanded += "typeformats:" + handler->typeFormatRequests() + ' '; expanded += "formats:" + handler->individualFormatRequests(); @@ -117,7 +116,7 @@ void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) postCommand("bb options:" + options + " vars:" + params.varList + ' ' + resultVar + expanded + " watchers:" + watchers.toHex(), - WatchUpdate, CB(handleStackFramePython), QVariant(params.tryPartial)); + Discardable, CB(handleStackFramePython), QVariant(params.tryPartial)); } void GdbEngine::handleStackFramePython(const GdbResponse &response) @@ -136,9 +135,11 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response) } GdbMi all; all.fromStringMultiple(out); - GdbMi data = all.findChild("data"); + + WatchHandler *handler = watchHandler(); QList<WatchData> list; + foreach (const GdbMi &child, data.children()) { WatchData dummy; dummy.iname = child.findChild("iname").data(); @@ -151,7 +152,7 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response) } else { dummy.name = _(child.findChild("name").data()); } - parseWatchData(watchHandler()->expandedINames(), dummy, child, &list); + parseWatchData(handler->expandedINames(), dummy, child, &list); } const GdbMi typeInfo = all.findChild("typeinfo"); if (typeInfo.type() == GdbMi::List) { @@ -169,15 +170,20 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response) list[i].size = ti.size; } - watchHandler()->insertBulkData(list); + if (!partial) { + handler->removeChildren("local"); + handler->removeChildren("watch"); + } + + handler->insertData(list); //PENDING_DEBUG("AFTER handleStackFrame()"); // FIXME: This should only be used when updateLocals() was // triggered by expanding an item in the view. - if (m_pendingWatchRequests <= 0) { + //if (m_pendingWatchRequests <= 0) { //PENDING_DEBUG("\n\n .... AND TRIGGERS MODEL UPDATE\n"); rebuildWatchModel(); - } + //} if (!partial) emit stackFrameCompleted(); } else { |