debugger: handle disabled breakpoints on debugger startup again

This commit is contained in:
hjk
2010-11-16 18:14:00 +01:00
parent a9a9143b5d
commit 4e1452fd59
3 changed files with 29 additions and 21 deletions

View File

@@ -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,18 +606,6 @@ 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, /**/);
@@ -629,10 +618,10 @@ void BreakHandler::notifyBreakpointInsertOk(BreakpointId id)
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)
@@ -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
{

View File

@@ -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;

View File

@@ -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