From 4b7d826daad17593b44a7c0a3925f6c7ec1e9d29 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen <christiaan.janssen@nokia.com> Date: Tue, 30 Nov 2010 11:35:17 +0100 Subject: [PATCH] QmlEngine: handling breakpoint insertions/removals Reviewed-by: hjk --- src/plugins/debugger/qml/qmlengine.cpp | 40 +++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 6b3e66e75a3..fd65d226990 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -467,25 +467,33 @@ void QmlEngine::attemptBreakpointSynchronization() handler->setEngine(id, this); } - //bool updateNeeded = false; JSAgentBreakpoints breakpoints; foreach (BreakpointId id, handler->engineBreakpointIds(this)) { - if (handler->state(id) == BreakpointInsertRequested) - handler->notifyBreakpointInsertProceeding(id); - QString processedFilename = handler->fileName(id); + if (handler->state(id) == BreakpointRemoveRequested) { + handler->notifyBreakpointRemoveProceeding(id); + handler->notifyBreakpointRemoveOk(id); + } else { + if (handler->state(id) == BreakpointInsertRequested) { + handler->notifyBreakpointInsertProceeding(id); + } + QString processedFilename = handler->fileName(id); #ifdef Q_OS_MACX - // Qt Quick Applications by default copy the qml directory to buildDir()/X.app/Contents/Resources - const QString applicationBundleDir - = QFileInfo(startParameters().executable).absolutePath() + "/../.."; - processedFilename = mangleFilenamePaths(handler->fileName(id), startParameters().projectDir, applicationBundleDir + "/Contents/Resources"); + // Qt Quick Applications by default copy the qml directory to buildDir()/X.app/Contents/Resources + const QString applicationBundleDir + = QFileInfo(startParameters().executable).absolutePath() + "/../.."; + processedFilename = mangleFilenamePaths(handler->fileName(id), startParameters().projectDir, applicationBundleDir + "/Contents/Resources"); #endif - if (isShadowBuildProject()) - processedFilename = toShadowBuildFilename(processedFilename); - JSAgentBreakpointData bp; - bp.fileName = processedFilename.toUtf8(); - bp.lineNumber = handler->lineNumber(id); - bp.functionName = handler->functionName(id).toUtf8(); - breakpoints.insert(bp); + if (isShadowBuildProject()) + processedFilename = toShadowBuildFilename(processedFilename); + JSAgentBreakpointData bp; + bp.fileName = processedFilename.toUtf8(); + bp.lineNumber = handler->lineNumber(id); + bp.functionName = handler->functionName(id).toUtf8(); + breakpoints.insert(bp); + if (handler->state(id) == BreakpointInsertProceeding) { + handler->notifyBreakpointInsertOk(id); + } + } } QByteArray reply; @@ -714,7 +722,7 @@ void QmlEngine::messageReceived(const QByteArray &message) foreach (BreakpointId id, handler->engineBreakpointIds(this)) { QString processedFilename = handler->fileName(id); if (processedFilename == file && handler->lineNumber(id) == line) { - handler->notifyBreakpointInsertOk(id); + QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/); BreakpointResponse br = handler->response(id); br.fileName = file; br.lineNumber = line; -- GitLab