aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-03-09 18:53:23 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-03-14 09:02:51 +0000
commitffe538a565e2f14ad276078891f18ec90d09be82 (patch)
treedd69cbe8e6d635159203d0f066ea5ea670bb1ea4 /src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
parent9180241819a9ea5e517977efc5bb031521a56cc6 (diff)
QV4DebugService: Reduce unnecessary recursion and redundancy
Large parts of the protocol are unnecessary. There is no reason to send a separate chunk of "handles" with almost every reply. The refs are given as part of the regular data and if the client wants to find out more, it can do further lookups. Also, it makes no sense to encode the function and script names as objects, as they are in fact not JavaScript objects. Unfortunately these cleanups require some cooperation from the client. Older clients will misbehave if we just drop the redundancy. Therefore, we introduce parameters which the client can explicitly set with the "connect" message. redundantRefs tells the service if redundant references are required, namesAsObjects tells it if script and function names have to be sent as objects/ Once we can require clients that support these options, we can drop the code that generates redundant data. Also, fix tst_qv4debugger::evaluateExpression() to actually check all the expressions evaluated, not only the first and second one. Task-number: QTBUG-42435 Change-Id: If93d2a2b9d0b8035f85dbef871bc1b03f199171d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
index 69e32189b8..bb13890ae4 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
@@ -86,6 +86,9 @@ public:
int selectedFrame() const;
void selectFrame(int frameNr);
+ bool clientRequiresRedundantRefs() const { return redundantRefs; }
+ bool clientRequiresNamesAsObjects() const { return namesAsObjects; }
+
QV4DebuggerAgent debuggerAgent;
protected:
@@ -105,6 +108,9 @@ private:
static int sequence;
int theSelectedFrame;
+ bool redundantRefs;
+ bool namesAsObjects;
+
void addHandler(V8CommandHandler* handler);
QHash<QString, V8CommandHandler*> handlers;
QScopedPointer<UnknownV8CommandHandler> unknownV8CommandHandler;