Commit 4b7d826d authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlEngine: handling breakpoint insertions/removals

Reviewed-by: hjk
parent 0269e60b
...@@ -467,25 +467,33 @@ void QmlEngine::attemptBreakpointSynchronization() ...@@ -467,25 +467,33 @@ void QmlEngine::attemptBreakpointSynchronization()
handler->setEngine(id, this); handler->setEngine(id, this);
} }
//bool updateNeeded = false;
JSAgentBreakpoints breakpoints; JSAgentBreakpoints breakpoints;
foreach (BreakpointId id, handler->engineBreakpointIds(this)) { foreach (BreakpointId id, handler->engineBreakpointIds(this)) {
if (handler->state(id) == BreakpointInsertRequested) if (handler->state(id) == BreakpointRemoveRequested) {
handler->notifyBreakpointInsertProceeding(id); handler->notifyBreakpointRemoveProceeding(id);
QString processedFilename = handler->fileName(id); handler->notifyBreakpointRemoveOk(id);
} else {
if (handler->state(id) == BreakpointInsertRequested) {
handler->notifyBreakpointInsertProceeding(id);
}
QString processedFilename = handler->fileName(id);
#ifdef Q_OS_MACX #ifdef Q_OS_MACX
// Qt Quick Applications by default copy the qml directory to buildDir()/X.app/Contents/Resources // Qt Quick Applications by default copy the qml directory to buildDir()/X.app/Contents/Resources
const QString applicationBundleDir const QString applicationBundleDir
= QFileInfo(startParameters().executable).absolutePath() + "/../.."; = QFileInfo(startParameters().executable).absolutePath() + "/../..";
processedFilename = mangleFilenamePaths(handler->fileName(id), startParameters().projectDir, applicationBundleDir + "/Contents/Resources"); processedFilename = mangleFilenamePaths(handler->fileName(id), startParameters().projectDir, applicationBundleDir + "/Contents/Resources");
#endif #endif
if (isShadowBuildProject()) if (isShadowBuildProject())
processedFilename = toShadowBuildFilename(processedFilename); processedFilename = toShadowBuildFilename(processedFilename);
JSAgentBreakpointData bp; JSAgentBreakpointData bp;
bp.fileName = processedFilename.toUtf8(); bp.fileName = processedFilename.toUtf8();
bp.lineNumber = handler->lineNumber(id); bp.lineNumber = handler->lineNumber(id);
bp.functionName = handler->functionName(id).toUtf8(); bp.functionName = handler->functionName(id).toUtf8();
breakpoints.insert(bp); breakpoints.insert(bp);
if (handler->state(id) == BreakpointInsertProceeding) {
handler->notifyBreakpointInsertOk(id);
}
}
} }
QByteArray reply; QByteArray reply;
...@@ -714,7 +722,7 @@ void QmlEngine::messageReceived(const QByteArray &message) ...@@ -714,7 +722,7 @@ void QmlEngine::messageReceived(const QByteArray &message)
foreach (BreakpointId id, handler->engineBreakpointIds(this)) { foreach (BreakpointId id, handler->engineBreakpointIds(this)) {
QString processedFilename = handler->fileName(id); QString processedFilename = handler->fileName(id);
if (processedFilename == file && handler->lineNumber(id) == line) { if (processedFilename == file && handler->lineNumber(id) == line) {
handler->notifyBreakpointInsertOk(id); QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/);
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
br.fileName = file; br.fileName = file;
br.lineNumber = line; br.lineNumber = line;
......
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