Commit 06afc4f8 authored by Olivier Goffart's avatar Olivier Goffart
Browse files

Qml JS Debugger: If the exact line number is not known, fallback to the function line number

parent b76cf034
......@@ -455,7 +455,10 @@ void JSDebuggerAgent::stopped(bool becauseOfException, const QScriptValue& excep
functionName = QLatin1String("<global>");
}
}
backtrace.append(qMakePair(functionName, qMakePair( QUrl(info.fileName()).toLocalFile(), info.lineNumber() ) ) );
int lineNumber = info.lineNumber();
if (lineNumber == -1) // if the line number is unknown, fallback to the function line number
lineNumber = info.functionStartLineNumber();
backtrace.append(qMakePair(functionName, qMakePair( QUrl(info.fileName()).toLocalFile(), lineNumber ) ) );
}
QList<JSAgentWatchData> watches;
foreach (const QString &expr, watchExpressions)
......
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