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

This commit is contained in:
Olivier Goffart
2010-07-27 18:19:11 +02:00
parent b76cf034de
commit 06afc4f85c

View File

@@ -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)