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,12 +130,16 @@ void JSDebuggerAgent::positionChange(qint64 scriptId, ...@@ -130,12 +130,16 @@ void JSDebuggerAgent::positionChange(qint64 scriptId,
// check breakpoints // check breakpoints
if (!breakpointList.isEmpty()) { if (!breakpointList.isEmpty()) {
QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId); QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId);
if (it != filenames.constEnd()) { if (it == filenames.constEnd()) {
QPair<QString, qint32> key = qMakePair(*it, lineNumber); // It is possible that the scripts are loaded before the agent is attached
if (breakpointList.contains(key)) { QString filename = QUrl(QScriptContextInfo(engine()->currentContext()).fileName()).toLocalFile();
stopped(); QPair<QString, qint32> key = qMakePair(filename, lineNumber);
return; it = filenames.insert(scriptId, filename);
} }
QPair<QString, qint32> key = qMakePair(*it, lineNumber);
if (breakpointList.contains(key)) {
} }
} }
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