forked from qt-creator/qt-creator
QmlV8DebuggerClient: Change breakpoint line number
V8 Debugger does not support changing line numbers of active brekpoints. Remove the existing breakpoint and add a new one. Change-Id: I0e6302d6d911887890d674960cc241f89c4cdc96 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -91,6 +91,8 @@ public:
|
|||||||
|
|
||||||
QmlAdapter *adapter() const;
|
QmlAdapter *adapter() const;
|
||||||
|
|
||||||
|
void insertBreakpoint(BreakpointModelId id);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void disconnected();
|
void disconnected();
|
||||||
void documentUpdated(QmlJS::Document::Ptr doc);
|
void documentUpdated(QmlJS::Document::Ptr doc);
|
||||||
@@ -130,7 +132,6 @@ private:
|
|||||||
void selectThread(int index);
|
void selectThread(int index);
|
||||||
|
|
||||||
void attemptBreakpointSynchronization();
|
void attemptBreakpointSynchronization();
|
||||||
void insertBreakpoint(BreakpointModelId id);
|
|
||||||
void removeBreakpoint(BreakpointModelId id);
|
void removeBreakpoint(BreakpointModelId id);
|
||||||
void changeBreakpoint(BreakpointModelId id);
|
void changeBreakpoint(BreakpointModelId id);
|
||||||
bool acceptsBreakpoint(BreakpointModelId id) const;
|
bool acceptsBreakpoint(BreakpointModelId id) const;
|
||||||
|
@@ -1131,23 +1131,21 @@ void QmlV8DebuggerClient::changeBreakpoint(const BreakpointModelId &id)
|
|||||||
BreakHandler *handler = d->engine->breakHandler();
|
BreakHandler *handler = d->engine->breakHandler();
|
||||||
const BreakpointParameters ¶ms = handler->breakpointData(id);
|
const BreakpointParameters ¶ms = handler->breakpointData(id);
|
||||||
|
|
||||||
|
BreakpointResponse br = handler->response(id);
|
||||||
if (params.type == BreakpointAtJavaScriptThrow) {
|
if (params.type == BreakpointAtJavaScriptThrow) {
|
||||||
d->setExceptionBreak(AllExceptions, params.enabled);
|
d->setExceptionBreak(AllExceptions, params.enabled);
|
||||||
|
br.enabled = params.enabled;
|
||||||
|
handler->setResponse(id, br);
|
||||||
} else if (params.type == BreakpointOnQmlSignalHandler) {
|
} else if (params.type == BreakpointOnQmlSignalHandler) {
|
||||||
d->setBreakpoint(QString(_(EVENT)), params.functionName, params.enabled);
|
d->setBreakpoint(QString(_(EVENT)), params.functionName, params.enabled);
|
||||||
|
br.enabled = params.enabled;
|
||||||
|
handler->setResponse(id, br);
|
||||||
} else {
|
} else {
|
||||||
int breakpoint = d->breakpoints.value(id);
|
//V8 supports only minimalistic changes in breakpoint
|
||||||
d->changeBreakpoint(breakpoint, params.enabled, QLatin1String(params.condition),
|
//Remove the breakpoint and add again
|
||||||
params.ignoreCount);
|
removeBreakpoint(id);
|
||||||
|
d->engine->insertBreakpoint(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
BreakpointResponse br = handler->response(id);
|
|
||||||
br.enabled = params.enabled;
|
|
||||||
br.condition = params.condition;
|
|
||||||
br.ignoreCount = params.ignoreCount;
|
|
||||||
handler->setResponse(id, br);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlV8DebuggerClient::synchronizeBreakpoints()
|
void QmlV8DebuggerClient::synchronizeBreakpoints()
|
||||||
|
Reference in New Issue
Block a user