Reviewers: Søren Gjesse,

Description:
Introduce an argument that allows to include some data neccessary for
displaying collapsed scope variables values in graphical debugger.

When request has 'inlineRefs' option simple type values will be written
in the response directly. Variables of other types in addition to 'ref'
property containing the value handle will contain some type information.

Please review this at http://codereview.chromium.org/140061

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/debug-delay.js
   M     src/mirror-delay.js


Index: src/mirror-delay.js
===================================================================
--- src/mirror-delay.js (revision 2246)
+++ src/mirror-delay.js (working copy)
@@ -1895,8 +1895,8 @@
  }


-JSONProtocolSerializer.prototype.compactFormat_ = function() {
-  return this.options_ && this.options_.compactFormat;
+JSONProtocolSerializer.prototype.inlineRefs_ = function() {
+  return this.options_ && this.options_.inlineRefs;
  }


@@ -1960,7 +1960,7 @@
    // the mirror to the referenced mirrors.
    if (reference &&
        (mirror.isValue() || mirror.isScript() || mirror.isContext())) {
-    if (this.compactFormat_() && mirror.isValue()) {
+    if (this.inlineRefs_() && mirror.isValue()) {
        return this.serializeReferenceWithDisplayData_(mirror);
      } else {
        this.add_(mirror);
@@ -2175,7 +2175,7 @@

    result.name = propertyMirror.name();
    var propertyValue = propertyMirror.value();
-  if (this.compactFormat_() && propertyValue.isValue()) {
+  if (this.inlineRefs_() && propertyValue.isValue()) {
      result.value = this.serializeReferenceWithDisplayData_(propertyValue);
    } else {
      if (propertyMirror.attributes() != PropertyAttribute.None) {
@@ -2248,7 +2248,9 @@
    content.index = mirror.scopeIndex();
    content.frameIndex = mirror.frameIndex();
    content.type = mirror.scopeType();
-  content.object = this.serializeReference(mirror.scopeObject());
+  content.object = this.inlineRefs_() ?
+                   this.serializeValue(mirror.scopeObject()) :
+                   this.serializeReference(mirror.scopeObject());
  }


Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js  (revision 2246)
+++ src/debug-delay.js  (working copy)
@@ -1193,6 +1193,10 @@
        if (!request.command) {
          throw new Error('Command not specified');
        }
+
+      if (request.arguments && request.arguments.inlineRefs) {
+        response.setOption('inlineRefs', true);
+      }

        if (request.command == 'continue') {
          this.continueRequest_(request, response);
@@ -1504,9 +1508,6 @@
      if (from_index < 0 || to_index < 0) {
        return response.failed('Invalid frame number');
      }
-    if (request.arguments.compactFormat) {
-      response.setOption('compactFormat', true);
-    }
    }

    // Adjust the index.
@@ -1696,10 +1697,6 @@
      response.setOption('includeSource', includeSource);
    }

-  if (request.arguments.compactFormat) {
-    response.setOption('compactFormat', true);
-  }
-
    // Lookup handles.
    var mirrors = {};
    for (var i = 0; i < handles.length; i++) {



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to