forked from qt-creator/qt-creator
Debugger: Simplify watcher handling in GdbEngine
There was only one user on GdbEngine::insertData left, and this always took the !isSomethingNeeded branch. Change-Id: Ibe51f7a7689be39ad3ffd60099a9cbe7b614648a Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -903,7 +903,6 @@ void GdbEngine::postCommand(const QByteArray &command, int flags,
|
|||||||
<< "INCREMENTS PENDING TO" << m_pendingBreakpointRequests);
|
<< "INCREMENTS PENDING TO" << m_pendingBreakpointRequests);
|
||||||
} else {
|
} else {
|
||||||
PENDING_DEBUG(" OTHER (IN):" << cmd.function
|
PENDING_DEBUG(" OTHER (IN):" << cmd.function
|
||||||
<< "LEAVES PENDING WATCH AT" << m_uncompleted.size()
|
|
||||||
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
|
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1189,15 +1188,13 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
|
|||||||
|
|
||||||
if (cmd.flags & RebuildBreakpointModel) {
|
if (cmd.flags & RebuildBreakpointModel) {
|
||||||
--m_pendingBreakpointRequests;
|
--m_pendingBreakpointRequests;
|
||||||
PENDING_DEBUG(" BREAKPOINT" << cmd.function
|
PENDING_DEBUG(" BREAKPOINT" << cmd.function);
|
||||||
<< "DECREMENTS PENDING TO" << m_uncompleted.size());
|
|
||||||
if (m_pendingBreakpointRequests <= 0) {
|
if (m_pendingBreakpointRequests <= 0) {
|
||||||
PENDING_DEBUG("\n\n ... AND TRIGGERS BREAKPOINT MODEL UPDATE\n");
|
PENDING_DEBUG("\n\n ... AND TRIGGERS BREAKPOINT MODEL UPDATE\n");
|
||||||
attemptBreakpointSynchronization();
|
attemptBreakpointSynchronization();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PENDING_DEBUG(" OTHER (OUT):" << cmd.function
|
PENDING_DEBUG(" OTHER (OUT):" << cmd.function
|
||||||
<< "LEAVES PENDING WATCH AT" << m_uncompleted.size()
|
|
||||||
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
|
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3740,13 +3737,13 @@ void GdbEngine::updateWatchData(const WatchData &data, const WatchUpdateFlags &f
|
|||||||
QByteArray processedName = "1-" + data.iname;
|
QByteArray processedName = "1-" + data.iname;
|
||||||
//qDebug() << "PROCESSED NAMES: " << processedName << m_processedNames;
|
//qDebug() << "PROCESSED NAMES: " << processedName << m_processedNames;
|
||||||
if (m_processedNames.contains(processedName)) {
|
if (m_processedNames.contains(processedName)) {
|
||||||
WatchData data1 = data;
|
showMessage(_("<Breaking endless loop for " + data.iname + '>'), LogMiscInput);
|
||||||
showMessage(_("<Breaking endless loop for " + data.iname + '>'),
|
auto item = new WatchItem(data);
|
||||||
LogMiscInput);
|
item->d.setAllUnneeded();
|
||||||
data1.setAllUnneeded();
|
item->d.setValue(_("<unavailable>"));
|
||||||
data1.setValue(_("<unavailable>"));
|
item->d.setHasChildren(false);
|
||||||
data1.setHasChildren(false);
|
watchHandler()->insertItem(item);
|
||||||
insertData(data1);
|
rebuildWatchModel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_processedNames.insert(processedName);
|
m_processedNames.insert(processedName);
|
||||||
@@ -3765,8 +3762,6 @@ void GdbEngine::updateWatchData(const WatchData &data, const WatchUpdateFlags &f
|
|||||||
|
|
||||||
void GdbEngine::rebuildWatchModel()
|
void GdbEngine::rebuildWatchModel()
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_completed.isEmpty());
|
|
||||||
QTC_CHECK(m_uncompleted.isEmpty());
|
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
++count;
|
++count;
|
||||||
PENDING_DEBUG("REBUILDING MODEL" << count);
|
PENDING_DEBUG("REBUILDING MODEL" << count);
|
||||||
@@ -3791,25 +3786,6 @@ void GdbEngine::updateLocals()
|
|||||||
updateLocalsPython(UpdateParameters());
|
updateLocalsPython(UpdateParameters());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::insertData(const WatchData &data)
|
|
||||||
{
|
|
||||||
PENDING_DEBUG("INSERT DATA" << data.toString());
|
|
||||||
if (data.isSomethingNeeded()) {
|
|
||||||
m_uncompleted.insert(data.iname);
|
|
||||||
WatchUpdateFlags flags;
|
|
||||||
flags.tryIncremental = true;
|
|
||||||
updateWatchData(data, flags);
|
|
||||||
} else {
|
|
||||||
m_completed.append(data);
|
|
||||||
m_uncompleted.remove(data.iname);
|
|
||||||
if (m_uncompleted.isEmpty()) {
|
|
||||||
watchHandler()->insertData(m_completed);
|
|
||||||
m_completed.clear();
|
|
||||||
rebuildWatchModel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GdbEngine::assignValueInDebugger(const WatchData *data,
|
void GdbEngine::assignValueInDebugger(const WatchData *data,
|
||||||
const QString &expression, const QVariant &value)
|
const QString &expression, const QVariant &value)
|
||||||
{
|
{
|
||||||
|
@@ -403,8 +403,6 @@ protected:
|
|||||||
void rebuildWatchModel();
|
void rebuildWatchModel();
|
||||||
void showToolTip();
|
void showToolTip();
|
||||||
|
|
||||||
void insertData(const WatchData &data);
|
|
||||||
|
|
||||||
void handleVarAssign(const DebuggerResponse &response);
|
void handleVarAssign(const DebuggerResponse &response);
|
||||||
void handleDetach(const DebuggerResponse &response);
|
void handleDetach(const DebuggerResponse &response);
|
||||||
void handleThreadGroupCreated(const GdbMi &result);
|
void handleThreadGroupCreated(const GdbMi &result);
|
||||||
@@ -474,10 +472,6 @@ protected:
|
|||||||
bool m_fullStartDone;
|
bool m_fullStartDone;
|
||||||
bool m_systemDumpersLoaded;
|
bool m_systemDumpersLoaded;
|
||||||
|
|
||||||
// Test
|
|
||||||
QList<WatchData> m_completed;
|
|
||||||
QSet<QByteArray> m_uncompleted;
|
|
||||||
|
|
||||||
static QString msgGdbStopFailed(const QString &why);
|
static QString msgGdbStopFailed(const QString &why);
|
||||||
static QString msgInferiorStopFailed(const QString &why);
|
static QString msgInferiorStopFailed(const QString &why);
|
||||||
static QString msgAttachedToStoppedInferior();
|
static QString msgAttachedToStoppedInferior();
|
||||||
|
@@ -239,7 +239,7 @@ public:
|
|||||||
void insertData(const WatchData &data); // Convenience.
|
void insertData(const WatchData &data); // Convenience.
|
||||||
void insertData(const QList<WatchData> &list);
|
void insertData(const QList<WatchData> &list);
|
||||||
void insertIncompleteData(const WatchData &data);
|
void insertIncompleteData(const WatchData &data);
|
||||||
void insertItem(WatchItem *item);
|
void insertItem(WatchItem *item); // Takes ownership.
|
||||||
void removeData(const QByteArray &iname);
|
void removeData(const QByteArray &iname);
|
||||||
void removeChildren(const QByteArray &iname);
|
void removeChildren(const QByteArray &iname);
|
||||||
void removeAllData(bool includeInspectData = false);
|
void removeAllData(bool includeInspectData = false);
|
||||||
|
Reference in New Issue
Block a user