Debugger: Show progress indicator while updating locals.

Change-Id: I4b26cbe71f5936f367f9add2b3a6c812446835d8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
David Schulz
2015-03-06 09:14:40 +01:00
committed by hjk
parent 467c441c93
commit 40dd248178
7 changed files with 28 additions and 0 deletions

View File

@@ -1500,6 +1500,7 @@ void CdbEngine::updateLocals(bool newFrame)
// Required arguments: frame // Required arguments: frame
str << blankSeparator << frameIndex; str << blankSeparator << frameIndex;
watchHandler()->updateRequested();
postExtensionCommand("locals", arguments, 0, postExtensionCommand("locals", arguments, 0,
[this, newFrame](const CdbResponse &r) { handleLocals(r, newFrame); }); [this, newFrame](const CdbResponse &r) { handleLocals(r, newFrame); });
} }
@@ -1859,6 +1860,7 @@ void CdbEngine::handleRegistersExt(const CdbResponse &response)
void CdbEngine::handleLocals(const CdbResponse &response, bool newFrame) void CdbEngine::handleLocals(const CdbResponse &response, bool newFrame)
{ {
if (response.success) { if (response.success) {
watchHandler()->updateFinished();
if (boolSetting(VerboseLog)) if (boolSetting(VerboseLog))
showMessage(QLatin1String("Locals: ") + QString::fromLatin1(response.extensionReply), LogDebug); showMessage(QLatin1String("Locals: ") + QString::fromLatin1(response.extensionReply), LogDebug);
WatchHandler *handler = watchHandler(); WatchHandler *handler = watchHandler();

View File

@@ -3755,6 +3755,7 @@ void GdbEngine::handleVarAssign(const DebuggerResponse &)
void GdbEngine::updateLocals() void GdbEngine::updateLocals()
{ {
watchHandler()->resetValueCache(); watchHandler()->resetValueCache();
watchHandler()->updateRequested();
updateLocalsPython(UpdateParameters()); updateLocalsPython(UpdateParameters());
} }
@@ -4767,6 +4768,7 @@ void GdbEngine::updateLocalsPython(const UpdateParameters &params)
void GdbEngine::handleStackFramePython(const DebuggerResponse &response, bool partial) void GdbEngine::handleStackFramePython(const DebuggerResponse &response, bool partial)
{ {
watchHandler()->updateFinished();
if (response.resultClass == ResultDone) { if (response.resultClass == ResultDone) {
QByteArray out = response.consoleStreamOutput; QByteArray out = response.consoleStreamOutput;
while (out.endsWith(' ') || out.endsWith('\n')) while (out.endsWith(' ') || out.endsWith('\n'))

View File

@@ -912,6 +912,7 @@ void LldbEngine::doUpdateLocals(UpdateParameters params)
m_lastDebuggableCommand = cmd; m_lastDebuggableCommand = cmd;
m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1");
watchHandler()->updateRequested();
runCommand(cmd); runCommand(cmd);
reloadRegisters(); reloadRegisters();
@@ -1009,6 +1010,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
} }
handler->purgeOutdatedItems(toDelete); handler->purgeOutdatedItems(toDelete);
handler->updateFinished();
DebuggerToolTipManager::updateEngine(this); DebuggerToolTipManager::updateEngine(this);
} }

View File

@@ -664,6 +664,7 @@ void PdbEngine::updateLocals()
//m_lastDebuggableCommand = cmd; //m_lastDebuggableCommand = cmd;
//m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); //m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1");
watchHandler()->updateRequested();
runCommand(cmd); runCommand(cmd);
} }

View File

@@ -1177,6 +1177,7 @@ void WatchHandler::cleanup()
m_model->m_expandedINames.clear(); m_model->m_expandedINames.clear();
theWatcherNames.remove(QByteArray()); theWatcherNames.remove(QByteArray());
m_model->reinitialize(); m_model->reinitialize();
emit m_model->updateFinished();
m_separatedView->hide(); m_separatedView->hide();
} }
@@ -1271,6 +1272,16 @@ void WatchHandler::resetValueCache()
}); });
} }
void WatchHandler::updateRequested()
{
emit m_model->updateRequested();
}
void WatchHandler::updateFinished()
{
emit m_model->updateFinished();
}
void WatchHandler::purgeOutdatedItems(const QSet<QByteArray> &inames) void WatchHandler::purgeOutdatedItems(const QSet<QByteArray> &inames)
{ {
foreach (const QByteArray &iname, inames) { foreach (const QByteArray &iname, inames) {

View File

@@ -177,6 +177,8 @@ signals:
void itemIsExpanded(const QModelIndex &idx); void itemIsExpanded(const QModelIndex &idx);
void inameIsExpanded(const QByteArray &iname); void inameIsExpanded(const QByteArray &iname);
void columnAdjustmentRequested(); void columnAdjustmentRequested();
void updateRequested();
void updateFinished();
}; };
class WatchHandler : public QObject class WatchHandler : public QObject
@@ -242,6 +244,8 @@ public:
void removeItemByIName(const QByteArray &iname); void removeItemByIName(const QByteArray &iname);
void removeAllData(bool includeInspectData = false); void removeAllData(bool includeInspectData = false);
void resetValueCache(); void resetValueCache();
void updateRequested();
void updateFinished();
void purgeOutdatedItems(const QSet<QByteArray> &inames); void purgeOutdatedItems(const QSet<QByteArray> &inames);
private: private:

View File

@@ -952,6 +952,12 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
this, &QAbstractItemView::setCurrentIndex); this, &QAbstractItemView::setCurrentIndex);
connect(watchModel, &WatchModelBase::itemIsExpanded, connect(watchModel, &WatchModelBase::itemIsExpanded,
this, &WatchTreeView::handleItemIsExpanded); this, &WatchTreeView::handleItemIsExpanded);
if (m_type == LocalsType) {
connect(watchModel, &WatchModelBase::updateRequested,
this, &WatchTreeView::showProgressIndicator);
connect(watchModel, &WatchModelBase::updateFinished,
this, &WatchTreeView::hideProgressIndicator);
}
} }
void WatchTreeView::rowActivated(const QModelIndex &index) void WatchTreeView::rowActivated(const QModelIndex &index)