aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-12-05 13:16:14 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2014-12-09 11:55:04 +0100
commit8397f640e81f0eff1f6f32ae4a35d40f115ea339 (patch)
tree2bb50bc6be262979cb9e7c49f02d96cbc5c50be5 /tests
parent4524856ae21f85d572155c8a399d43116143e25c (diff)
QML Debugging: Fix crash when stepping through try-catch block.
Also fix the stack-trace generation, otherwise the debugger engine would report a breakpoint hit on the wrong line. Task-number: QTBUG-42723 Change-Id: I1f655a5174b28a1c9c31c85bbe023fbce5ddbb96 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qv4debugger/tst_qv4debugger.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
index 63bfffacaa..fcbdcbc201 100644
--- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
@@ -286,6 +286,7 @@ private slots:
// exceptions:
void pauseOnThrow();
+ void breakInCatch();
void evaluateExpression();
@@ -612,6 +613,25 @@ void tst_qv4debugger::pauseOnThrow()
QCOMPARE(m_debuggerAgent->m_thrownValue.toString(), QString("hard"));
}
+void tst_qv4debugger::breakInCatch()
+{
+ QString script =
+ "try {\n"
+ " throw 'catch...'\n"
+ "} catch (e) {\n"
+ " console.log(e, 'me');\n"
+ "}\n";
+
+ m_debuggerAgent->addBreakPoint("breakInCatch", 4);
+ evaluateJavaScript(script, "breakInCatch");
+ QVERIFY(m_debuggerAgent->m_wasPaused);
+ QCOMPARE(m_debuggerAgent->m_pauseReason, BreakPoint);
+ QCOMPARE(m_debuggerAgent->m_statesWhenPaused.count(), 1);
+ QV4::Debugging::Debugger::ExecutionState state = m_debuggerAgent->m_statesWhenPaused.first();
+ QCOMPARE(state.fileName, QString("breakInCatch"));
+ QCOMPARE(state.lineNumber, 4);
+}
+
void tst_qv4debugger::evaluateExpression()
{
QString script =