aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-07-18 11:55:44 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-07-18 13:37:01 +0000
commitd140614a1df7d9563acef5092f92e9f31c14723b (patch)
treeda5853c8d7ea44b895cd20fe0a4cc570583b535a
parent98f848ef834d1be33929b39ca1a85ef42b8c9a78 (diff)
V4 Debuger: Drop namesAsObjects option
There is no client that uses this anymore, and dropping it allows us to eliminate a lot of code. Change-Id: I6b09669c9dd7fcf9c2d249f133bfbb78d2b6f7f4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp62
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h9
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp23
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h4
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp86
5 files changed, 40 insertions, 144 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index 2d1dcee0aa..876bb6bb60 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -111,7 +111,7 @@ int QV4DataCollector::encodeScopeType(QV4::Heap::ExecutionContext::ContextType s
}
QV4DataCollector::QV4DataCollector(QV4::ExecutionEngine *engine)
- : m_engine(engine), m_namesAsObjects(true)
+ : m_engine(engine)
{
m_values.set(engine, engine->newArrayObject());
}
@@ -192,11 +192,6 @@ QJsonObject QV4DataCollector::lookupRef(Ref ref)
{
QJsonObject dict;
- if (m_namesAsObjects) {
- if (lookupSpecialRef(ref, &dict))
- return dict;
- }
-
dict.insert(QStringLiteral("handle"), qint64(ref));
QV4::Scope scope(engine());
QV4::ScopedValue value(scope, getValue(ref));
@@ -208,36 +203,6 @@ QJsonObject QV4DataCollector::lookupRef(Ref ref)
return dict;
}
-// TODO: Drop this method once we don't need to support namesAsObjects anymore
-QV4DataCollector::Ref QV4DataCollector::addFunctionRef(const QString &functionName)
-{
- Q_ASSERT(m_namesAsObjects);
- Ref ref = addRef(QV4::Primitive::emptyValue(), false);
-
- QJsonObject dict;
- dict.insert(QStringLiteral("handle"), qint64(ref));
- dict.insert(QStringLiteral("type"), QStringLiteral("function"));
- dict.insert(QStringLiteral("name"), functionName);
- m_specialRefs.insert(ref, dict);
-
- return ref;
-}
-
-// TODO: Drop this method once we don't need to support namesAsObjects anymore
-QV4DataCollector::Ref QV4DataCollector::addScriptRef(const QString &scriptName)
-{
- Q_ASSERT(m_namesAsObjects);
- Ref ref = addRef(QV4::Primitive::emptyValue(), false);
-
- QJsonObject dict;
- dict.insert(QStringLiteral("handle"), qint64(ref));
- dict.insert(QStringLiteral("type"), QStringLiteral("script"));
- dict.insert(QStringLiteral("name"), scriptName);
- m_specialRefs.insert(ref, dict);
-
- return ref;
-}
-
bool QV4DataCollector::isValidRef(QV4DataCollector::Ref ref) const
{
QV4::Scope scope(engine());
@@ -291,13 +256,8 @@ QJsonObject QV4DataCollector::buildFrame(const QV4::StackFrame &stackFrame, int
QJsonObject frame;
frame[QLatin1String("index")] = frameNr;
frame[QLatin1String("debuggerFrame")] = false;
- if (m_namesAsObjects) {
- frame[QLatin1String("func")] = toRef(addFunctionRef(stackFrame.function));
- frame[QLatin1String("script")] = toRef(addScriptRef(stackFrame.source));
- } else {
- frame[QLatin1String("func")] = stackFrame.function;
- frame[QLatin1String("script")] = stackFrame.source;
- }
+ frame[QLatin1String("func")] = stackFrame.function;
+ frame[QLatin1String("script")] = stackFrame.source;
frame[QLatin1String("line")] = stackFrame.line - 1;
if (stackFrame.column >= 0)
frame[QLatin1String("column")] = stackFrame.column;
@@ -339,8 +299,6 @@ QJsonObject QV4DataCollector::buildFrame(const QV4::StackFrame &stackFrame, int
void QV4DataCollector::clear()
{
m_values.set(engine(), engine()->newArrayObject());
- m_specialRefs.clear();
- m_namesAsObjects = true;
}
QV4DataCollector::Ref QV4DataCollector::addRef(QV4::Value value, bool deduplicate)
@@ -366,7 +324,7 @@ QV4DataCollector::Ref QV4DataCollector::addRef(QV4::Value value, bool deduplicat
QV4::ScopedObject array(scope, m_values.value());
if (deduplicate) {
for (Ref i = 0; i < array->getLength(); ++i) {
- if (array->get(i) == value.rawValue() && !m_specialRefs.contains(i))
+ if (array->get(i) == value.rawValue())
return i;
}
}
@@ -384,18 +342,6 @@ QV4::ReturnedValue QV4DataCollector::getValue(Ref ref)
return array->get(ref, nullptr);
}
-// TODO: Drop this method once we don't need to support namesAsObjects anymore
-bool QV4DataCollector::lookupSpecialRef(Ref ref, QJsonObject *dict)
-{
- Q_ASSERT(m_namesAsObjects);
- SpecialRefs::const_iterator it = m_specialRefs.constFind(ref);
- if (it == m_specialRefs.cend())
- return false;
-
- *dict = it.value();
- return true;
-}
-
QJsonArray QV4DataCollector::collectProperties(const QV4::Object *object)
{
QJsonArray res;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
index 4851e2fa29..bc178fa2db 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
@@ -68,11 +68,6 @@ public:
QV4DataCollector(QV4::ExecutionEngine *engine);
Ref addValueRef(const QV4::ScopedValue &value);
- Ref addFunctionRef(const QString &functionName); // only for namesAsObjects
- Ref addScriptRef(const QString &scriptName); // only for namesAsObjects
-
- void setNamesAsObjects(bool namesAsObjects) { m_namesAsObjects = namesAsObjects; }
- bool namesAsObjects() const { return m_namesAsObjects; }
bool isValidRef(Ref ref) const;
QJsonObject lookupRef(Ref ref);
@@ -86,7 +81,6 @@ public:
private:
Ref addRef(QV4::Value value, bool deduplicate = true);
QV4::ReturnedValue getValue(Ref ref);
- bool lookupSpecialRef(Ref ref, QJsonObject *dict); // only for namesAsObjects
QJsonArray collectProperties(const QV4::Object *object);
QJsonObject collectAsJson(const QString &name, const QV4::ScopedValue &value);
@@ -94,9 +88,6 @@ private:
QV4::ExecutionEngine *m_engine;
QV4::PersistentValue m_values;
- typedef QHash<Ref, QJsonObject> SpecialRefs; // only for namesAsObjects
- SpecialRefs m_specialRefs; // only for namesAsObjects
- bool m_namesAsObjects;
};
QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
index 42e4566a4f..aa05a62323 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
@@ -122,13 +122,6 @@ protected:
response.insert(QStringLiteral("running"), debugService->debuggerAgent.isRunning());
}
- QV4DataCollector *saneCollector(QV4Debugger *debugger)
- {
- QV4DataCollector *collector = debugger->collector();
- collector->setNamesAsObjects(debugService->clientRequiresNamesAsObjects());
- return collector;
- }
-
void createErrorResponse(const QString &msg)
{
QJsonValue command = req.value(QLatin1String("command"));
@@ -289,7 +282,7 @@ public:
return;
}
- BacktraceJob job(saneCollector(debugger), fromFrame, toFrame);
+ BacktraceJob job(debugger->collector(), fromFrame, toFrame);
debugger->runInEngine(&job);
// response:
@@ -324,7 +317,7 @@ public:
return;
}
- FrameJob job(saneCollector(debugger), frameNr);
+ FrameJob job(debugger->collector(), frameNr);
debugger->runInEngine(&job);
if (!job.wasSuccessful()) {
createErrorResponse(QStringLiteral("frame retrieval failed"));
@@ -370,7 +363,7 @@ public:
return;
}
- ScopeJob job(saneCollector(debugger), frameNr, scopeNr);
+ ScopeJob job(debugger->collector(), frameNr, scopeNr);
debugger->runInEngine(&job);
if (!job.wasSuccessful()) {
createErrorResponse(QStringLiteral("scope retrieval failed"));
@@ -410,7 +403,7 @@ public:
debugger = debuggers.first();
}
- ValueLookupJob job(handles, saneCollector(debugger));
+ ValueLookupJob job(handles, debugger->collector());
debugger->runInEngine(&job);
if (!job.exceptionMessage().isEmpty()) {
createErrorResponse(job.exceptionMessage());
@@ -629,7 +622,7 @@ public:
}
ExpressionEvalJob job(debugger->engine(), frame, context, expression,
- saneCollector(debugger));
+ debugger->collector());
debugger->runInEngine(&job);
if (job.hasExeption()) {
createErrorResponse(job.exceptionMessage());
@@ -660,7 +653,7 @@ V4CommandHandler *QV4DebugServiceImpl::v4CommandHandler(const QString &command)
QV4DebugServiceImpl::QV4DebugServiceImpl(QObject *parent) :
QQmlConfigurableDebugService<QV4DebugService>(1, parent),
- debuggerAgent(this), theSelectedFrame(0), namesAsObjects(true),
+ debuggerAgent(this), theSelectedFrame(0),
unknownV4CommandHandler(new UnknownV4CommandHandler)
{
addHandler(new V4VersionRequest);
@@ -764,9 +757,7 @@ void QV4DebugServiceImpl::messageReceived(const QByteArray &message)
if (type == V4_CONNECT) {
QJsonObject parameters = QJsonDocument::fromJson(payload).object();
- namesAsObjects = true;
- if (parameters.contains("namesAsObjects"))
- namesAsObjects = parameters.value("namesAsObjects").toBool();
+ Q_UNUSED(parameters); // For future protocol changes
emit messageToClient(name(), packMessage(type));
stopWaiting();
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
index 30ea5cd0bf..b1f7053c36 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
@@ -86,8 +86,6 @@ public:
int selectedFrame() const;
void selectFrame(int frameNr);
- bool clientRequiresNamesAsObjects() const { return namesAsObjects; }
-
QV4DebuggerAgent debuggerAgent;
protected:
@@ -107,8 +105,6 @@ private:
static int sequence;
int theSelectedFrame;
- bool namesAsObjects;
-
void addHandler(V4CommandHandler* handler);
QHash<QString, V4CommandHandler*> handlers;
QScopedPointer<UnknownV4CommandHandler> unknownV4CommandHandler;
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
index afd1afaabc..59e1cd8160 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -260,7 +260,7 @@ public:
this, &QJSDebugClient::onStateChanged);
}
- void connect(bool namesAsObjects = false);
+ void connect();
void interrupt();
void continueDebugging(StepAction stepAction);
@@ -306,10 +306,9 @@ public:
};
-void QJSDebugClient::connect(bool namesAsObjects)
+void QJSDebugClient::connect()
{
- QJSValue jsonVal = parser.call(QJSValueList() << QLatin1String("{}"));
- jsonVal.setProperty("namesAsObjects", QJSValue(namesAsObjects));
+ const QJSValue jsonVal = parser.call(QJSValueList() << QLatin1String("{}"));
sendMessage(packMessage(CONNECT,
stringify.call(QJSValueList() << jsonVal).toString().toUtf8()));
}
@@ -807,10 +806,9 @@ void tst_QQmlDebugJS::interrupt()
{
//void connect()
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
m_client->interrupt();
QVERIFY(waitForClientSignal(SIGNAL(interruptRequested())));
@@ -820,10 +818,9 @@ void tst_QQmlDebugJS::getVersion()
{
//void version()
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(connected())));
m_client->version();
@@ -834,10 +831,9 @@ void tst_QQmlDebugJS::getVersionWhenAttaching()
{
//void version()
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene, QLatin1String(TIMER_QMLFILE), false), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
m_client->version();
QVERIFY(waitForClientSignal(SIGNAL(result())));
@@ -847,10 +843,9 @@ void tst_QQmlDebugJS::disconnect()
{
//void disconnect()
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
m_client->disconnect();
QVERIFY(waitForClientSignal(SIGNAL(result())));
@@ -860,13 +855,12 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnCompleted()
{
//void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1)
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
@@ -882,13 +876,12 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComponentCreated()
{
//void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1)
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
QCOMPARE(init(qmlscene, CREATECOMPONENT_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
@@ -903,12 +896,11 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComponentCreated()
void tst_QQmlDebugJS::setBreakpointInScriptOnTimerCallback()
{
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 35;
QCOMPARE(init(qmlscene, TIMER_QMLFILE), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
//We can set the breakpoint after connect() here because the timer is repeating and if we miss
//its first iteration we can still catch the second one.
m_client->setBreakpoint(QLatin1String(TIMER_QMLFILE), sourceLine, -1, true);
@@ -927,13 +919,12 @@ void tst_QQmlDebugJS::setBreakpointInScriptInDifferentFile()
{
//void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1)
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 31;
QCOMPARE(init(qmlscene, LOADJSFILE_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(TEST_JSFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
@@ -949,14 +940,13 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComment()
{
//void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1)
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
int actualLine = 36;
QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QEXPECT_FAIL("", "Relocation of breakpoints is disabled right now", Abort);
QVERIFY(waitForClientSignal(SIGNAL(stopped()), 1));
@@ -973,14 +963,13 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnEmptyLine()
{
//void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1)
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 35;
int actualLine = 36;
QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QEXPECT_FAIL("", "Relocation of breakpoints is disabled right now", Abort);
QVERIFY(waitForClientSignal(SIGNAL(stopped()), 1));
@@ -997,13 +986,12 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnOptimizedBinding()
{
//void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1)
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 39;
QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
@@ -1018,13 +1006,12 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnOptimizedBinding()
void tst_QQmlDebugJS::setBreakpointInScriptWithCondition()
{
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int out = 10;
int sourceLine = 37;
QCOMPARE(init(qmlscene, CONDITION_QMLFILE), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
//The breakpoint is in a timer loop so we can set it after connect().
m_client->setBreakpoint(QLatin1String(CONDITION_QMLFILE), sourceLine, 1, true, QLatin1String("a > 10"));
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
@@ -1057,14 +1044,13 @@ void tst_QQmlDebugJS::setBreakpointInScriptWithCondition()
void tst_QQmlDebugJS::setBreakpointInScriptThatQuits()
{
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene, QUIT_QMLFILE), ConnectSuccess);
int sourceLine = 36;
m_client->setBreakpoint(QLatin1String(QUIT_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
@@ -1101,13 +1087,12 @@ void tst_QQmlDebugJS::clearBreakpoint()
{
//void clearBreakpoint(int breakpoint);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine1 = 37;
int sourceLine2 = 38;
QCOMPARE(init(qmlscene, CHANGEBREAKPOINT_QMLFILE), ConnectSuccess);
- m_client->connect(namesAsObjects);
+ m_client->connect();
//The breakpoints are in a timer loop so we can set them after connect().
//Furthermore the breakpoints should be hit in the right order because setting of breakpoints
//can only occur in the QML event loop. (see QCOMPARE for sourceLine2 below)
@@ -1150,11 +1135,10 @@ void tst_QQmlDebugJS::setExceptionBreak()
{
//void setExceptionBreak(QString type, bool enabled = false);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene, EXCEPTION_QMLFILE), ConnectSuccess);
m_client->setExceptionBreak(QJSDebugClient::All,true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
}
@@ -1162,13 +1146,12 @@ void tst_QQmlDebugJS::stepNext()
{
//void continueDebugging(StepAction stepAction, int stepCount = 1);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 37;
QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->continueDebugging(QJSDebugClient::Next);
@@ -1195,14 +1178,13 @@ void tst_QQmlDebugJS::stepIn()
{
//void continueDebugging(StepAction stepAction, int stepCount = 1);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 41;
int actualLine = 36;
QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, 1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QCOMPARE(responseBody(m_client).value("sourceLine").toInt(), sourceLine);
@@ -1218,14 +1200,13 @@ void tst_QQmlDebugJS::stepOut()
{
//void continueDebugging(StepAction stepAction, int stepCount = 1);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 37;
int actualLine = 41;
QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QCOMPARE(responseBody(m_client).value("sourceLine").toInt(), sourceLine);
@@ -1241,7 +1222,6 @@ void tst_QQmlDebugJS::continueDebugging()
{
//void continueDebugging(StepAction stepAction, int stepCount = 1);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine1 = 41;
int sourceLine2 = 38;
@@ -1249,7 +1229,7 @@ void tst_QQmlDebugJS::continueDebugging()
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine1, -1, true);
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine2, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->continueDebugging(QJSDebugClient::Continue);
@@ -1268,13 +1248,12 @@ void tst_QQmlDebugJS::backtrace()
{
//void backtrace(int fromFrame = -1, int toFrame = -1, bool bottom = false);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->backtrace();
@@ -1285,13 +1264,12 @@ void tst_QQmlDebugJS::getFrameDetails()
{
//void frame(int number = -1);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->frame();
@@ -1302,13 +1280,12 @@ void tst_QQmlDebugJS::getScopeDetails()
{
//void scope(int number = -1, int frameNumber = -1);
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->scope();
@@ -1337,13 +1314,12 @@ void tst_QQmlDebugJS::evaluateInLocalScope()
{
//void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap());
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
int sourceLine = 34;
QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess);
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->frame();
@@ -1421,12 +1397,11 @@ void tst_QQmlDebugJS::getScripts()
{
//void scripts(int types = -1, QList<int> ids = QList<int>(), bool includeSource = false, QVariant filter = QVariant());
QFETCH(bool, qmlscene);
- QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene), ConnectSuccess);
m_client->setBreakpoint(QString(TEST_QMLFILE), 35, -1, true);
- m_client->connect(namesAsObjects);
+ m_client->connect();
QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->scripts();
@@ -1514,11 +1489,8 @@ QList<QQmlDebugClient *> tst_QQmlDebugJS::createClients()
void tst_QQmlDebugJS::targetData()
{
QTest::addColumn<bool>("qmlscene");
- QTest::addColumn<bool>("namesAsObjects");
- QTest::newRow("custom / objects") << false << true;
- QTest::newRow("qmlscene / objects") << true << true;
- QTest::newRow("custom / strings") << false << false;
- QTest::newRow("qmlscene / strings") << true << false;
+ QTest::newRow("custom") << false;
+ QTest::newRow("qmlscene") << true;
}
bool tst_QQmlDebugJS::waitForClientSignal(const char *signal, int timeout)