Commit 4e1452fd authored by hjk's avatar hjk
Browse files

debugger: handle disabled breakpoints on debugger startup again

parent a9a9143b
......@@ -592,6 +592,7 @@ static bool isAllowedTransition(BreakpointState from, BreakpointState to)
void BreakHandler::setState(BreakpointId id, BreakpointState state)
{
Iterator it = m_storage.find(id);
//qDebug() << "BREAKPOINT STATE TRANSITION" << id << it->state << state;
QTC_ASSERT(it != m_storage.end(), return);
QTC_ASSERT(isAllowedTransition(it->state, state),
qDebug() << "UNEXPECTED BREAKPOINT STATE TRANSITION"
......@@ -605,45 +606,33 @@ void BreakHandler::setState(BreakpointId id, BreakpointState state)
it->state = state;
}
static bool needsChange(const BreakpointParameters &data,
const BreakpointResponse &response)
{
if (!data.conditionsMatch(response.condition))
return true;
if (data.ignoreCount != response.ignoreCount)
return true;
if (data.enabled != response.enabled)
return true;
return false;
}
void BreakHandler::notifyBreakpointInsertProceeding(BreakpointId id)
{
QTC_ASSERT(state(id)== BreakpointInsertRequested, /**/);
QTC_ASSERT(state(id) == BreakpointInsertRequested, /**/);
setState(id, BreakpointInsertProceeding);
}
void BreakHandler::notifyBreakpointInsertOk(BreakpointId id)
{
QTC_ASSERT(state(id)== BreakpointInsertProceeding, /**/);
QTC_ASSERT(state(id) == BreakpointInsertProceeding, /**/);
setState(id, BreakpointInserted);
ConstIterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return);
if (needsChange(it->data, it->response)) {
setState(id, BreakpointChangeRequested);
scheduleSynchronization();
}
//if (it0->needsChange(it->data, it->response)) {
// setState(id, BreakpointChangeRequested);
// scheduleSynchronization();
//}
}
void BreakHandler::notifyBreakpointInsertFailed(BreakpointId id)
{
QTC_ASSERT(state(id)== BreakpointInsertProceeding, /**/);
QTC_ASSERT(state(id) == BreakpointInsertProceeding, /**/);
setState(id, BreakpointDead);
}
void BreakHandler::notifyBreakpointRemoveProceeding(BreakpointId id)
{
QTC_ASSERT(state(id)== BreakpointRemoveRequested, /**/);
QTC_ASSERT(state(id) == BreakpointRemoveRequested, /**/);
setState(id, BreakpointRemoveProceeding);
}
......@@ -911,6 +900,14 @@ void BreakHandler::setResponse(BreakpointId id, const BreakpointResponse &data)
QTC_ASSERT(it != m_storage.end(), return);
it->response = data;
updateMarker(id);
//qDebug() << "SET RESPONSE: " << id << it->state << it->needsChange();
if (it->state == BreakpointChangeProceeding
|| it->state == BreakpointInsertProceeding) {
if (it->needsChange())
setState(id, BreakpointChangeRequested);
else
setState(id, BreakpointInserted);
}
}
void BreakHandler::setBreakpointData(BreakpointId id, const BreakpointParameters &data)
......@@ -967,6 +964,17 @@ static QString stateToString(BreakpointState state)
}
};
bool BreakHandler::BreakpointItem::needsChange() const
{
if (!data.conditionsMatch(response.condition))
return true;
if (data.ignoreCount != response.ignoreCount)
return true;
if (data.enabled != response.enabled)
return true;
return false;
}
bool BreakHandler::BreakpointItem::isLocatedAt
(const QString &fileName, int lineNumber, bool useMarkerPosition) const
{
......
......@@ -177,6 +177,7 @@ private:
void destroyMarker();
bool isPending() const { return response.pending; }
bool needsChange() const;
bool isLocatedAt(const QString &fileName, int lineNumber,
bool useMarkerPosition) const;
QString toToolTip() const;
......
......@@ -2103,7 +2103,6 @@ void GdbEngine::updateBreakpointDataFromOutput(BreakpointId id, const GdbMi &bkp
response.fileName = name;
breakHandler()->setResponse(id, response);
breakHandler()->notifyBreakpointInsertOk(id);
}
QString GdbEngine::breakLocation(const QString &file) const
......
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