m_disassemblerAgent(engine),
m_memoryAgent(engine)
{
- connect(&m_locationTimer, SIGNAL(timeout()), SLOT(doRemoveLocationMark()));
+ connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
}
~DebuggerEnginePrivate() {}
m_runControl->bringApplicationToForeground(m_inferiorPid);
}
- void removeLocationMark()
+ void scheduleResetLocation()
{
+ m_stackHandler.scheduleResetLocation();
m_locationTimer.setSingleShot(true);
m_locationTimer.start(80);
}
- void doRemoveLocationMark()
+ void resetLocation()
{
m_locationTimer.stop();
m_locationMark.reset();
+ m_stackHandler.resetLocation();
+ m_disassemblerAgent.resetLocation();
}
public:
void DebuggerEngine::resetLocation()
{
- d->m_disassemblerAgent.resetLocation();
- d->removeLocationMark();
+ // Do it after some delay to avoid flicker.
+ d->scheduleResetLocation();
}
void DebuggerEngine::gotoLocation(const Location &loc)
//if (m_shuttingDown)
// return;
- d->doRemoveLocationMark();
+ d->resetLocation();
const QString file = loc.fileName();
const int line = loc.lineNumber();
void DebuggerEnginePrivate::doShutdownInferior()
{
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
- m_engine->resetLocation();
+ resetLocation();
m_targetState = DebuggerFinished;
m_engine->showMessage(_("CALL: SHUTDOWN INFERIOR"));
m_engine->shutdownInferior();
{
m_engine->showMessage(_("NOTE: FINISH DEBUGGER"));
QTC_ASSERT(state() == DebuggerFinished, qDebug() << state());
- m_engine->resetLocation();
+ resetLocation();
if (!m_engine->isSlaveEngine()) {
QTC_ASSERT(m_runControl, return);
m_runControl->debuggingFinished();
void DebuggerEngine::notifyInferiorExited()
{
showMessage(_("NOTE: INFERIOR EXITED"));
- resetLocation();
+ d->resetLocation();
// This can be issued in almost any state. We assume, though,
// that at this point of time the inferior is not running anymore,
: m_positionIcon(QIcon(QLatin1String(":/debugger/images/location_16.png"))),
m_emptyIcon(QIcon(QLatin1String(":/debugger/images/debugger_empty_14.png")))
{
+ m_resetLocationScheduled = false;
+ m_contentsValid = false;
m_currentIndex = 0;
m_canExpand = false;
connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered()),
if (role == Qt::DecorationRole && index.column() == 0) {
// Return icon that indicates whether this is the active stack frame
- return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon;
+ return (m_contentsValid && index.row() == m_currentIndex)
+ ? m_positionIcon : m_emptyIcon;
}
if (role == Qt::ToolTipRole)
const StackFrame &frame = m_stackFrames.at(index.row());
const bool isValid = (frame.isUsable() && !frame.function.isEmpty())
|| debuggerCore()->boolSetting(OperateByInstruction);
- return isValid ? QAbstractTableModel::flags(index) : Qt::ItemFlags(0);
+ return isValid && m_contentsValid
+ ? QAbstractTableModel::flags(index) : Qt::ItemFlags(0);
}
StackFrame StackHandler::currentFrame() const
void StackHandler::setFrames(const StackFrames &frames, bool canExpand)
{
+ m_resetLocationScheduled = false;
+ m_contentsValid = true;
m_canExpand = canExpand;
m_stackFrames = frames;
if (m_currentIndex >= m_stackFrames.size())
return m_stackFrames;
}
-bool StackHandler::isDebuggingDebuggingHelpers() const
+void StackHandler::scheduleResetLocation()
{
- for (int i = m_stackFrames.size(); --i >= 0; )
- if (m_stackFrames.at(i).function.startsWith(QLatin1String("qDumpObjectData")))
- return true;
- return false;
+ m_resetLocationScheduled = true;
+ m_contentsValid = false;
+}
+
+void StackHandler::resetLocation()
+{
+ if (m_resetLocationScheduled) {
+ m_resetLocationScheduled = false;
+ reset();
+ }
}
} // namespace Internal
// Called from StackHandler after a new stack list has been received
void removeAll();
QAbstractItemModel *model() { return this; }
- bool isDebuggingDebuggingHelpers() const;
+ bool isContentsValid() const { return m_contentsValid; }
+ void scheduleResetLocation();
+ void resetLocation();
private:
// QAbstractTableModel
const QVariant m_positionIcon;
const QVariant m_emptyIcon;
bool m_canExpand;
+ bool m_resetLocationScheduled;
+ bool m_contentsValid;
};
} // namespace Internal