summaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger/qjsdebuggeragent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/debugger/qjsdebuggeragent.cpp')
-rw-r--r--src/declarative/debugger/qjsdebuggeragent.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/declarative/debugger/qjsdebuggeragent.cpp b/src/declarative/debugger/qjsdebuggeragent.cpp
index 683032b..5fc64e1 100644
--- a/src/declarative/debugger/qjsdebuggeragent.cpp
+++ b/src/declarative/debugger/qjsdebuggeragent.cpp
@@ -511,27 +511,24 @@ void QJSDebuggerAgentPrivate::positionChange(qint64 scriptId, int lineNumber, in
// check breakpoints
if (!breakpoints.isEmpty()) {
- QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId);
- QScriptContext *ctx = engine()->currentContext();
- QScriptContextInfo info(ctx);
- if (it == filenames.constEnd()) {
- // It is possible that the scripts are loaded before the agent is attached
- QString filename = info.fileName();
+ const QScriptContext *ctx = engine()->currentContext();
+ const QScriptContextInfo info(ctx);
- JSAgentStackData frame;
- frame.functionName = info.functionName().toUtf8();
-
- QPair<QString, qint32> key = qMakePair(filename, lineNumber);
- it = filenames.insert(scriptId, filename);
- }
+ if (info.functionType() == QScriptContextInfo::ScriptFunction) {
+ QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId);
+ // It is possible that the scripts are loaded before the agent is attached
+ if (it == filenames.constEnd()) {
+ it = filenames.insert(scriptId, info.fileName());
+ }
- const QString filePath = it.value();
- JSAgentBreakpoints bps = fileNameToBreakpoints.values(fileName(filePath)).toSet();
+ const QString filePath = it.value();
+ const JSAgentBreakpoints bps = fileNameToBreakpoints.values(fileName(filePath)).toSet();
- foreach (const JSAgentBreakpointData &bp, bps) {
- if (bp.lineNumber == lineNumber) {
- stopped();
- return;
+ foreach (const JSAgentBreakpointData &bp, bps) {
+ if (bp.lineNumber == lineNumber) {
+ stopped();
+ return;
+ }
}
}
}