forked from qt-creator/qt-creator
debugger: handle disabled breakpoints on debugger startup again
This commit is contained in:
@@ -592,6 +592,7 @@ static bool isAllowedTransition(BreakpointState from, BreakpointState to)
|
|||||||
void BreakHandler::setState(BreakpointId id, BreakpointState state)
|
void BreakHandler::setState(BreakpointId id, BreakpointState state)
|
||||||
{
|
{
|
||||||
Iterator it = m_storage.find(id);
|
Iterator it = m_storage.find(id);
|
||||||
|
//qDebug() << "BREAKPOINT STATE TRANSITION" << id << it->state << state;
|
||||||
QTC_ASSERT(it != m_storage.end(), return);
|
QTC_ASSERT(it != m_storage.end(), return);
|
||||||
QTC_ASSERT(isAllowedTransition(it->state, state),
|
QTC_ASSERT(isAllowedTransition(it->state, state),
|
||||||
qDebug() << "UNEXPECTED BREAKPOINT STATE TRANSITION"
|
qDebug() << "UNEXPECTED BREAKPOINT STATE TRANSITION"
|
||||||
@@ -605,45 +606,33 @@ void BreakHandler::setState(BreakpointId id, BreakpointState state)
|
|||||||
it->state = 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)
|
void BreakHandler::notifyBreakpointInsertProceeding(BreakpointId id)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state(id)== BreakpointInsertRequested, /**/);
|
QTC_ASSERT(state(id) == BreakpointInsertRequested, /**/);
|
||||||
setState(id, BreakpointInsertProceeding);
|
setState(id, BreakpointInsertProceeding);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakHandler::notifyBreakpointInsertOk(BreakpointId id)
|
void BreakHandler::notifyBreakpointInsertOk(BreakpointId id)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state(id)== BreakpointInsertProceeding, /**/);
|
QTC_ASSERT(state(id) == BreakpointInsertProceeding, /**/);
|
||||||
setState(id, BreakpointInserted);
|
setState(id, BreakpointInserted);
|
||||||
ConstIterator it = m_storage.find(id);
|
ConstIterator it = m_storage.find(id);
|
||||||
QTC_ASSERT(it != m_storage.end(), return);
|
QTC_ASSERT(it != m_storage.end(), return);
|
||||||
if (needsChange(it->data, it->response)) {
|
//if (it0->needsChange(it->data, it->response)) {
|
||||||
setState(id, BreakpointChangeRequested);
|
// setState(id, BreakpointChangeRequested);
|
||||||
scheduleSynchronization();
|
// scheduleSynchronization();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakHandler::notifyBreakpointInsertFailed(BreakpointId id)
|
void BreakHandler::notifyBreakpointInsertFailed(BreakpointId id)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state(id)== BreakpointInsertProceeding, /**/);
|
QTC_ASSERT(state(id) == BreakpointInsertProceeding, /**/);
|
||||||
setState(id, BreakpointDead);
|
setState(id, BreakpointDead);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakHandler::notifyBreakpointRemoveProceeding(BreakpointId id)
|
void BreakHandler::notifyBreakpointRemoveProceeding(BreakpointId id)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state(id)== BreakpointRemoveRequested, /**/);
|
QTC_ASSERT(state(id) == BreakpointRemoveRequested, /**/);
|
||||||
setState(id, BreakpointRemoveProceeding);
|
setState(id, BreakpointRemoveProceeding);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,6 +900,14 @@ void BreakHandler::setResponse(BreakpointId id, const BreakpointResponse &data)
|
|||||||
QTC_ASSERT(it != m_storage.end(), return);
|
QTC_ASSERT(it != m_storage.end(), return);
|
||||||
it->response = data;
|
it->response = data;
|
||||||
updateMarker(id);
|
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)
|
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
|
bool BreakHandler::BreakpointItem::isLocatedAt
|
||||||
(const QString &fileName, int lineNumber, bool useMarkerPosition) const
|
(const QString &fileName, int lineNumber, bool useMarkerPosition) const
|
||||||
{
|
{
|
||||||
|
@@ -177,6 +177,7 @@ private:
|
|||||||
|
|
||||||
void destroyMarker();
|
void destroyMarker();
|
||||||
bool isPending() const { return response.pending; }
|
bool isPending() const { return response.pending; }
|
||||||
|
bool needsChange() const;
|
||||||
bool isLocatedAt(const QString &fileName, int lineNumber,
|
bool isLocatedAt(const QString &fileName, int lineNumber,
|
||||||
bool useMarkerPosition) const;
|
bool useMarkerPosition) const;
|
||||||
QString toToolTip() const;
|
QString toToolTip() const;
|
||||||
|
@@ -2103,7 +2103,6 @@ void GdbEngine::updateBreakpointDataFromOutput(BreakpointId id, const GdbMi &bkp
|
|||||||
response.fileName = name;
|
response.fileName = name;
|
||||||
|
|
||||||
breakHandler()->setResponse(id, response);
|
breakHandler()->setResponse(id, response);
|
||||||
breakHandler()->notifyBreakpointInsertOk(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GdbEngine::breakLocation(const QString &file) const
|
QString GdbEngine::breakLocation(const QString &file) const
|
||||||
|
Reference in New Issue
Block a user