Commit 839ad4da authored by hjk's avatar hjk
Browse files

debugger: rename some watch-update related variables to prepare a similar

mechanism for breakpoints.
parent f6447d5d
......@@ -143,7 +143,7 @@ void GdbEngine::runDirectDebuggingHelperClassic(const WatchData &data, bool dump
var.setValue(data);
postCommand(cmd, WatchUpdate, CB(handleDebuggingHelperValue3Classic), var);
showStatusMessage(msgRetrievingWatchData(m_pendingRequests + 1), 10000);
showStatusMessage(msgRetrievingWatchData(m_pendingWatchRequests + 1), 10000);
}
void GdbEngine::runDebuggingHelperClassic(const WatchData &data0, bool dumpChildren)
......@@ -195,7 +195,7 @@ void GdbEngine::runDebuggingHelperClassic(const WatchData &data0, bool dumpChild
postCommand(cmd.toLatin1(), WatchUpdate | NonCriticalResponse);
showStatusMessage(msgRetrievingWatchData(m_pendingRequests + 1), 10000);
showStatusMessage(msgRetrievingWatchData(m_pendingWatchRequests + 1), 10000);
// retrieve response
postCommand("p (char*)&qDumpOutBuffer", WatchUpdate,
......@@ -394,7 +394,7 @@ void GdbEngine::handleDebuggingHelperValue2Classic(const GdbResponse &response)
if (m_cookieForToken.contains(response.token - 1)) {
m_cookieForToken.remove(response.token - 1);
debugMessage(_("DETECTING LOST COMMAND %1").arg(response.token - 1));
--m_pendingRequests;
--m_pendingWatchRequests;
data.setError(WatchData::msgNotInScope());
insertData(data);
return;
......
......@@ -258,7 +258,7 @@ void GdbEngine::initializeVariables()
m_breakListUpdating = false;
m_oldestAcceptableToken = -1;
m_outputCodec = QTextCodec::codecForLocale();
m_pendingRequests = 0;
m_pendingWatchRequests = 0;
m_commandsDoneCallback = 0;
m_commandsToRunOnTemporaryBreak.clear();
m_cookieForToken.clear();
......@@ -717,13 +717,13 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
return;
}
if (cmd.flags & RebuildModel) {
++m_pendingRequests;
if (cmd.flags & RebuildWatchModel) {
++m_pendingWatchRequests;
PENDING_DEBUG(" MODEL:" << cmd.command << "=>" << cmd.callbackName
<< "INCREMENTS PENDING TO" << m_pendingRequests);
<< "INCREMENTS PENDING TO" << m_pendingWatchRequests);
} else {
PENDING_DEBUG(" OTHER (IN):" << cmd.command << "=>" << cmd.callbackName
<< "LEAVES PENDING AT" << m_pendingRequests);
<< "LEAVES PENDING AT" << m_pendingWatchRequests);
}
if ((cmd.flags & NeedsStop) || !m_commandsToRunOnTemporaryBreak.isEmpty()) {
......@@ -939,17 +939,17 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
(m_gdbAdapter->*cmd.adapterCallback)(*response);
}
if (cmd.flags & RebuildModel) {
--m_pendingRequests;
if (cmd.flags & RebuildWatchModel) {
--m_pendingWatchRequests;
PENDING_DEBUG(" WATCH" << cmd.command << "=>" << cmd.callbackName
<< "DECREMENTS PENDING TO" << m_pendingRequests);
if (m_pendingRequests <= 0) {
<< "DECREMENTS PENDING TO" << m_pendingWatchRequests);
if (m_pendingWatchRequests <= 0) {
PENDING_DEBUG("\n\n ... AND TRIGGERS MODEL UPDATE\n");
rebuildModel();
rebuildWatchModel();
}
} else {
PENDING_DEBUG(" OTHER (OUT):" << cmd.command << "=>" << cmd.callbackName
<< "LEAVES PENDING AT" << m_pendingRequests);
<< "LEAVES PENDING AT" << m_pendingWatchRequests);
}
// Commands were queued, but we were in RunningRequested state, so the interrupt
......@@ -3189,8 +3189,8 @@ void GdbEngine::updateWatchData(const WatchData &data)
} else {
// Bump requests to avoid model rebuilding during the nested
// updateWatchModel runs.
++m_pendingRequests;
PENDING_DEBUG("UPDATE WATCH BUMPS PENDING UP TO " << m_pendingRequests);
++m_pendingWatchRequests;
PENDING_DEBUG("UPDATE WATCH BUMPS PENDING UP TO " << m_pendingWatchRequests);
#if 1
QMetaObject::invokeMethod(this, "updateWatchDataHelper",
Qt::QueuedConnection, Q_ARG(WatchData, data));
......@@ -3212,13 +3212,13 @@ void GdbEngine::updateWatchDataHelper(const WatchData &data)
updateSubItemClassic(data);
//PENDING_DEBUG("INTERNAL TRIGGERING UPDATE WATCH MODEL");
--m_pendingRequests;
PENDING_DEBUG("UPDATE WATCH DONE BUMPS PENDING DOWN TO " << m_pendingRequests);
if (m_pendingRequests <= 0)
rebuildModel();
--m_pendingWatchRequests;
PENDING_DEBUG("UPDATE WATCH DONE BUMPS PENDING DOWN TO " << m_pendingWatchRequests);
if (m_pendingWatchRequests <= 0)
rebuildWatchModel();
}
void GdbEngine::rebuildModel()
void GdbEngine::rebuildWatchModel()
{
static int count = 0;
++count;
......@@ -3417,7 +3417,7 @@ void GdbEngine::handleChildren(const WatchData &data0, const GdbMi &item,
void GdbEngine::updateLocals(const QVariant &cookie)
{
m_pendingRequests = 0;
m_pendingWatchRequests = 0;
if (hasPython())
updateLocalsPython(QByteArray());
else
......
......@@ -174,8 +174,8 @@ private: ////////// Gdb Command Management //////////
NoFlags = 0,
NeedsStop = 1, // The command needs a stopped inferior
Discardable = 2, // No need to wait for the reply before continuing inferior
RebuildModel = 4, // Trigger model rebuild when no such commands are pending any more
WatchUpdate = Discardable | RebuildModel,
RebuildWatchModel = 4, // Trigger model rebuild when no such commands are pending any more
WatchUpdate = Discardable | RebuildWatchModel,
NonCriticalResponse = 8, // We can live without recieving an answer
RunRequest = 16, // Callback expects GdbResultRunning instead of GdbResultDone
ExitRequest = 32, // Callback expects GdbResultExit instead of GdbResultDone
......@@ -244,7 +244,7 @@ private: ////////// Gdb Command Management //////////
// out of date and discarded.
int m_oldestAcceptableToken;
int m_pendingRequests; // Watch updating commands in flight
int m_pendingWatchRequests; // Watch updating commands in flight
typedef void (GdbEngine::*CommandsDoneCallback)();
// function called after all previous responses have been received
......@@ -442,7 +442,7 @@ private: ////////// View & Data Stuff //////////
void virtual updateWatchData(const WatchData &data);
Q_SLOT void updateWatchDataHelper(const WatchData &data);
void rebuildModel();
void rebuildWatchModel();
bool showToolTip();
void insertData(const WatchData &data);
......
......@@ -179,9 +179,9 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response)
//PENDING_DEBUG("AFTER handleStackFrame()");
// FIXME: This should only be used when updateLocals() was
// triggered by expanding an item in the view.
if (m_pendingRequests <= 0) {
if (m_pendingWatchRequests <= 0) {
//PENDING_DEBUG("\n\n .... AND TRIGGERS MODEL UPDATE\n");
rebuildModel();
rebuildWatchModel();
}
} else {
debugMessage(_("DUMPER FAILED: " + response.toString()));
......
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