Commit 0d08db21 authored by hjk's avatar hjk Committed by hjk

debugger: be more restrictive with discardable results

This is expected to create more console output, which needs to be fixed
on a case-by-case base.

Change-Id: Ic83fb1d4c4392cfb421d9c2eba52b7bae705daae
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 9a0636f7
......@@ -202,6 +202,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters,
m_hasInferiorThreadList = false;
m_sourcesListUpdating = false;
m_oldestAcceptableToken = -1;
m_nonDiscardableCount = 0;
m_outputCodec = QTextCodec::codecForLocale();
m_pendingWatchRequests = 0;
m_pendingBreakpointRequests = 0;
......@@ -808,6 +809,9 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
}
if (!(cmd.flags & Discardable))
++m_nonDiscardableCount;
// FIXME: clean up logic below
if (cmd.flags & Immediate) {
// This should always be sent.
......@@ -1078,6 +1082,9 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
}
}
if (!(cmd.flags & Discardable))
--m_nonDiscardableCount;
if (cmd.callback)
(this->*cmd.callback)(*response);
else if (cmd.adapterCallback)
......@@ -2271,14 +2278,24 @@ void GdbEngine::handleExecuteReturn(const GdbResponse &response)
void GdbEngine::setTokenBarrier()
{
if (m_nonDiscardableCount > 0) {
showMessage(_("--- CANNOT SET TOKEN BARRIER: "), LogMiscInput);
foreach (const GdbCommand &cookie, m_cookieForToken)
showMessage(QString::fromLatin1("CMD: %1, FLAGS: %2")
.arg(_(cookie.command)).arg(cookie.flags), LogMiscInput);
QTC_ASSERT(false, return);
return;
}
bool good = true;
foreach (const GdbCommand &cookie, m_cookieForToken) {
QTC_ASSERT(!cookie.callback || (cookie.flags & Discardable),
if (!(cookie.flags & Discardable)) {
qDebug() << "CMD:" << cookie.command
<< " FLAGS:" << cookie.flags
<< " CALLBACK:" << cookie.callbackName;
return
);
good = false;
}
}
QTC_ASSERT(good, return);
PENDING_DEBUG("\n--- token barrier ---\n");
showMessage(_("--- token barrier ---"), LogMiscInput);
if (debuggerCore()->boolSetting(LogTimeStamps))
......
......@@ -407,6 +407,7 @@ private: ////////// Gdb Command Management //////////
// of evaluation. Responses with older tokens are considers
// out of date and discarded.
int m_oldestAcceptableToken;
int m_nonDiscardableCount;
int m_pendingWatchRequests; // Watch updating commands in flight
int m_pendingBreakpointRequests; // Watch updating commands in flight
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment