Commit 82279906 authored by Aurindam Jana's avatar Aurindam Jana Committed by Kai Koehne
Browse files

QmlJsDebugger: Handle Breakpoint states correctly.

The QmlJsDebugger likes to remove breakpoints in the
BreakpointInsertProceeding state. The state transition from
BreakpointInsertProceeding to BreakpointRemoveRequested is now
allowed. The state of breakpoint is set to BreakpointInserted
only when the breakpoint is hit.

Change-Id: I2fdd8d916363866fd920af7488f78d92df54d93b
Reviewed-on: http://codereview.qt-project.org/5899

Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
parent 5bfb5d9c
...@@ -842,7 +842,8 @@ static bool isAllowedTransition(BreakpointState from, BreakpointState to) ...@@ -842,7 +842,8 @@ static bool isAllowedTransition(BreakpointState from, BreakpointState to)
case BreakpointInsertProceeding: case BreakpointInsertProceeding:
return to == BreakpointInserted return to == BreakpointInserted
|| to == BreakpointDead || to == BreakpointDead
|| to == BreakpointChangeRequested; || to == BreakpointChangeRequested
|| to == BreakpointRemoveRequested;
case BreakpointChangeRequested: case BreakpointChangeRequested:
return to == BreakpointChangeProceeding; return to == BreakpointChangeProceeding;
case BreakpointChangeProceeding: case BreakpointChangeProceeding:
...@@ -1011,6 +1012,7 @@ void BreakHandler::removeBreakpoint(BreakpointModelId id) ...@@ -1011,6 +1012,7 @@ void BreakHandler::removeBreakpoint(BreakpointModelId id)
BREAK_ASSERT(it != m_storage.end(), return); BREAK_ASSERT(it != m_storage.end(), return);
switch (it->state) { switch (it->state) {
case BreakpointInserted: case BreakpointInserted:
case BreakpointInsertProceeding:
setState(id, BreakpointRemoveRequested); setState(id, BreakpointRemoveRequested);
scheduleSynchronization(); scheduleSynchronization();
break; break;
......
...@@ -416,6 +416,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data) ...@@ -416,6 +416,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
QString processedFilename = handler->fileName(id); QString processedFilename = handler->fileName(id);
if (processedFilename == file && handler->lineNumber(id) == line) { if (processedFilename == file && handler->lineNumber(id) == line) {
if (handler->state(id) == BreakpointInsertProceeding)
handler->notifyBreakpointInsertOk(id);
QTC_CHECK(handler->state(id) == BreakpointInserted); QTC_CHECK(handler->state(id) == BreakpointInserted);
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
br.fileName = file; br.fileName = file;
......
Supports Markdown
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