Commit 95b06415 authored by Olivier Goffart's avatar Olivier Goffart
Browse files

QML Debugger: Restore the ability to set breakpoint on all files.

The agent is only attached when creator request it.  But this may occurs
After some scripts have been initialized. Which mean we do not get the
scriptLoad call.
parent 2785f013
......@@ -130,14 +130,18 @@ void JSDebuggerAgent::positionChange(qint64 scriptId,
// check breakpoints
if (!breakpointList.isEmpty()) {
QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId);
if (it != filenames.constEnd()) {
if (it == filenames.constEnd()) {
// It is possible that the scripts are loaded before the agent is attached
QString filename = QUrl(QScriptContextInfo(engine()->currentContext()).fileName()).toLocalFile();
QPair<QString, qint32> key = qMakePair(filename, lineNumber);
it = filenames.insert(scriptId, filename);
}
QPair<QString, qint32> key = qMakePair(*it, lineNumber);
if (breakpointList.contains(key)) {
stopped();
return;
}
}
}
switch (state) {
......
Markdown is supported
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