aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-27 14:40:26 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-10 10:05:01 +0000
commitdc341e6c1c524330b838a62ceeaa148a01dc0729 (patch)
treee42e93b6af0ecb347d4f3850b8e04acd796a4b66 /src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
parente01bea8999d2f58add58874bd3e6792f509b131b (diff)
Change data collection for debugging to use QV4::Value.
This patch changes the variable collection to store QV4::Value values into a JS array, which is retained by the collector. This prevents any GC issues, and gives a nice mapping from handle (used in the debugging protocol) to JS value. It also allows for easy "shallow" object serialization: any lookup can start with the QV4::Value, and add any values it encounters to the array. Testing is changed to use this collector directly, thereby testing the class that is actually used to generate protocol data. Task-number: QTBUG-47061 Change-Id: Iec75c4f74c08495e2a8af0fedf304f76f8385fd7 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
index 4829ae414f..23bffa368a 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
@@ -94,7 +94,8 @@ public:
QJsonObject buildScope(int frameNr, int scopeNr, QV4::Debugging::Debugger *debugger);
QJsonArray buildRefs();
- QJsonValue lookup(int refId) const;
+ QJsonValue lookup(QV4::Debugging::DataCollector::Ref refId);
+ QJsonValue toRef(QV4::Debugging::DataCollector::Ref ref);
QJsonObject buildFrame(const QV4::StackFrame &stackFrame, int frameNr,
QV4::Debugging::Debugger *debugger);
@@ -103,7 +104,7 @@ public:
void clearHandles(QV4::ExecutionEngine *engine);
- VariableCollector *collector() const;
+ QV4::Debugging::DataCollector *collector() const;
QV4DebuggerAgent debuggerAgent;
protected:
@@ -125,8 +126,9 @@ private:
static int debuggerIndex;
static int sequence;
const int version;
+ QV4::Debugging::DataCollector::Refs collectedRefs;
- QScopedPointer<VariableCollector> theCollector;
+ QScopedPointer<QV4::Debugging::DataCollector> theCollector;
int theSelectedFrame;
void addHandler(V8CommandHandler* handler);