summaryrefslogtreecommitdiff
path: root/src/plugins/debugger
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-02-24 14:38:57 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-02-24 15:09:26 +0100
commit398c1fd9df6e8358e353313c6890c9fba39b8032 (patch)
tree7f310f7a5f285fab9f8addda110126e58b036e21 /src/plugins/debugger
parent265866f6fcfb09675f0fd75ff178591829b1faed (diff)
downloadqt-creator-398c1fd9df6e8358e353313c6890c9fba39b8032.tar.gz
more thoughtfull setTokenBarrier() placement
also, make it complain upon abuse of this call. Conflicts: src/plugins/debugger/gdbengine.cpp
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r--src/plugins/debugger/gdbengine.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp
index 6fc0423cd5..7067223936 100644
--- a/src/plugins/debugger/gdbengine.cpp
+++ b/src/plugins/debugger/gdbengine.cpp
@@ -776,9 +776,7 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record)
GdbCookie cmd = m_cookieForToken.take(token);
- // FIXME: this falsely rejects results from the custom dumper recognition
- // procedure, too...
- if (record.token < m_oldestAcceptableToken && cmd.type >= 300) {
+ if (record.token < m_oldestAcceptableToken) {
//qDebug() << "### SKIPPING OLD RESULT " << record.toString();
//QMessageBox::information(m_mainWindow, tr("Skipped"), "xxx");
return;
@@ -1659,13 +1657,11 @@ bool GdbEngine::startDebugger()
sendCommand("attach " + QString::number(q->m_attachedPID));
} else {
// StartInternal or StartExternal
- emit gdbInputAvailable(QString(), QString());
sendCommand("-file-exec-and-symbols " + fileName, GdbFileExecAndSymbols);
//sendCommand("file " + fileName, GdbFileExecAndSymbols);
#ifdef Q_OS_MAC
sendCommand("sharedlibrary apply-load-rules all");
#endif
- //setTokenBarrier();
if (!q->m_processArgs.isEmpty())
sendCommand("-exec-arguments " + q->m_processArgs.join(" "));
#ifndef Q_OS_MAC
@@ -1687,7 +1683,6 @@ void GdbEngine::continueInferior()
{
q->resetLocation();
setTokenBarrier();
- emit gdbInputAvailable(QString(), QString());
qq->notifyInferiorRunningRequested();
sendCommand("-exec-continue", GdbExecContinue);
}
@@ -1722,7 +1717,6 @@ void GdbEngine::handleStart(const GdbResultRecord &response)
void GdbEngine::stepExec()
{
setTokenBarrier();
- emit gdbInputAvailable(QString(), QString());
qq->notifyInferiorRunningRequested();
sendCommand("-exec-step", GdbExecStep);
}
@@ -1744,7 +1738,6 @@ void GdbEngine::stepOutExec()
void GdbEngine::nextExec()
{
setTokenBarrier();
- emit gdbInputAvailable(QString(), QString());
qq->notifyInferiorRunningRequested();
sendCommand("-exec-next", GdbExecNext);
}
@@ -1796,14 +1789,19 @@ void GdbEngine::jumpToLineExec(const QString &fileName, int lineNumber)
/*!
\fn void GdbEngine::setTokenBarrier()
- \brief Sets up internal structures to handle a new debugger turn.
+ \brief Discard the results of all pending watch-updating commands.
This method is called at the beginning of all step/next/finish etc.
debugger functions.
+ If non-watch-updating commands with call-backs are still in the pipe,
+ it will complain.
*/
void GdbEngine::setTokenBarrier()
{
+ foreach (const GdbCookie &ck, m_cookieForToken)
+ QTC_ASSERT(ck.synchronized || ck.type == GdbInvalidCommand, return);
+ emit gdbInputAvailable(QString(), "--- token barrier ---");
m_oldestAcceptableToken = currentToken();
}
@@ -2494,6 +2492,8 @@ void GdbEngine::activateFrame(int frameIndex)
QTC_ASSERT(frameIndex < stackHandler->stackSize(), return);
if (oldIndex != frameIndex) {
+ setTokenBarrier();
+
// Assuming this always succeeds saves a roundtrip.
// Otherwise the lines below would need to get triggered
// after a response to this -stack-select-frame here.
@@ -2970,6 +2970,7 @@ void GdbEngine::setUseCustomDumpers(bool on)
Q_UNUSED(on);
// FIXME: a bit too harsh, but otherwise the treeview sometimes look funny
//m_expandedINames.clear();
+ setTokenBarrier();
updateLocals();
}
@@ -3444,6 +3445,7 @@ void GdbEngine::handleVarAssign()
// everything might have changed, force re-evaluation
// FIXME: Speed this up by re-using variables and only
// marking values as 'unknown'
+ setTokenBarrier();
updateLocals();
}
@@ -3660,8 +3662,6 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
void GdbEngine::updateLocals()
{
- setTokenBarrier();
-
m_pendingRequests = 0;
PENDING_DEBUG("\nRESET PENDING");