Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47061

QML Debug Service returns invalid scope data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.5.1
    • 5.5.0
    • None
    • QtCreator 3.4. Other reports suggest it also happens with 3.5
    • 34f9b8d322f74793221029ef8a6e1053f2a0d2ae

    Description

      Consider the following example:

      import QtQuick 2.4
      import QtQuick.Window 2.2
      
      Window {
          visible: true
          Rectangle {
              anchors.fill: parent
              property alias mouseArea: mouseArea
      
              width: 360
              height: 360
      
              MouseArea {
                  id: mouseArea
                  anchors.fill: parent
                  onClicked: {
                      var b  = { "employees":[
                                        {"firstName":"John", "lastName":"Doe"},
                                        {"firstName":"Anna", "lastName":"Smith"},
                                        {"firstName":"Peter", "lastName":"Jones"}
                                    ] }
                      var x = {a: 12, b: [1,2,3]};
                      Qt.quit();
                  }
              }
          }
      }
      

      In QtCreator set a breakpoint at "Qt.quit()" and trigger the code clicking somewhere. With Qt 5.4 you get the correct values for the local variables x and b in the "Loxals and Expressions" view. With Qt 5.5 you get data from some mouse event:

      		
      	Locals		
      		this		object
      		x		object
      			accepted	true	boolean
      			button	1	number
      			buttons	0	number
      			isClick	true	boolean
      			modifiers	0	number
      			objectName		string
      			objectNameChanged		object
      			wasHeld	false	boolean
      			x	54	number
      			y	54	number
      	Inspector		
      		Window	object	Window
      	Expressions		
      	returned value		
      	Tooltip		
      

      The protocol messages in the debugger log are as follows:

      V8DebuggerClient: receiving V8DEBUG v8message
      dV8DebuggerClient: receiving v8message {"body":{"breakpoints":[0],"invocationText":"onClicked","script":{"name":"qrc:/main.qml"},"sourceLine":22},"event":"break","seq":2,"type":"event"}
      dNOTE: INFERIOR SPONTANEOUS STOP
      sStopped.
      dState changed from InferiorRunOk(11) to InferiorStopOk(14)
      sQML debugger activated
      dNOTE: INFERIOR SPONTANEOUS STOP
      sStopped.
      dState changed from InferiorRunOk(11) to InferiorStopOk(14) [master]
      dV8DebuggerClient: sending V8DEBUG v8request {"seq":2,"type":"request","command":"backtrace","arguments":{}}
      dV8DebuggerClient: receiving V8DEBUG v8message
      dV8DebuggerClient: receiving v8message {"body":{"frames":[{"debuggerFrame":false,"func":{"ref":0},"index":0,"line":22,"receiver":{"ref":2},"scopes":[{"index":0,"type":1},{"index":2,"type":0}],"script":{"ref":1}}],"fromFrame":0,"toFrame":1},"command":"backtrace","refs":[{"className":"Function","handle":0,"name":"onClicked","type":"function"},{"handle":1,"name":"qrc:/main.qml","type":"script"},{"handle":2,"properties":[],"type":"object"}],"request_seq":2,"running":false,"seq":3,"success":true,"type":"response"}
      dV8DebuggerClient: sending V8DEBUG v8request {"seq":3,"type":"request","command":"scope","arguments":{"number":0}}
      dV8DebuggerClient: receiving V8DEBUG v8message
      dV8DebuggerClient: receiving v8message {"body":{"frameIndex":0,"index":0,"object":{"ref":-11},"type":1},"command":"scope","refs":[{"handle":4,"type":"string","value":""},{"handle":5,"type":"number","value":54},{"handle":6,"type":"number","value":1},{"handle":7,"type":"number","value":0},{"handle":8,"type":"boolean","value":false},{"handle":9,"type":"boolean","value":true},{"handle":10,"properties":[],"type":"object"},{"handle":3,"properties":[{"name":"objectName","ref":4},{"name":"x","ref":5},{"name":"y","ref":5},{"name":"button","ref":6},{"name":"buttons","ref":7},{"name":"modifiers","ref":7},{"name":"wasHeld","ref":8},{"name":"isClick","ref":9},{"name":"accepted","ref":9},{"name":"objectNameChanged","ref":10}],"type":"object"},{"handle":-11,"properties":[{"name":"mouse","ref":3},{"name":"b","ref":3},{"name":"x","ref":3}],"type":"object"}],"request_seq":3,"running":false,"seq":4,"success":true,"type":"response"}
      dV8DebuggerClient: sending V8DEBUG v8request {"seq":4,"type":"request","command":"lookup","arguments":{"handles":[3,3,3]}}
      dV8DebuggerClient: receiving V8DEBUG v8message
      dV8DebuggerClient: receiving v8message {"body":{"3":{"handle":3,"properties":[{"name":"objectName","ref":4},{"name":"x","ref":5},{"name":"y","ref":5},{"name":"button","ref":6},{"name":"buttons","ref":7},{"name":"modifiers","ref":7},{"name":"wasHeld","ref":8},{"name":"isClick","ref":9},{"name":"accepted","ref":9},{"name":"objectNameChanged","ref":10}],"type":"object"}},"command":"lookup","refs":[{"handle":9,"type":"boolean","value":true},{"handle":8,"type":"boolean","value":false},{"handle":10,"properties":[],"type":"object"},{"handle":5,"type":"number","value":54},{"handle":4,"type":"string","value":""},{"handle":7,"type":"number","value":0},{"handle":6,"type":"number","value":1},{"handle":9,"type":"boolean","value":true},{"handle":8,"type":"boolean","value":false},{"handle":10,"properties":[],"type":"object"},{"handle":5,"type":"number","value":54},{"handle":4,"type":"string","value":""},{"handle":7,"type":"number","value":0},{"handle":6,"type":"number","value":1},{"handle":9,"type":"boolean","value":true},{"handle":8,"type":"boolean","value":false},{"handle":10,"properties":[],"type":"object"},{"handle":5,"type":"number","value":54},{"handle":4,"type":"string","value":""},{"handle":7,"type":"number","value":0},{"handle":6,"type":"number","value":1}],"request_seq":4,"running":false,"seq":5,"success":true,"type":"response"}
      
      dV8DebuggerClient: sending V8DEBUG v8request {"seq":5,"type":"request","command":"lookup","arguments":{"handles":[3]}}
      dV8DebuggerClient: receiving V8DEBUG v8message
      dV8DebuggerClient: receiving v8message {"body":{"3":{"handle":3,"properties":[{"name":"objectName","ref":4},{"name":"x","ref":5},{"name":"y","ref":5},{"name":"button","ref":6},{"name":"buttons","ref":7},{"name":"modifiers","ref":7},{"name":"wasHeld","ref":8},{"name":"isClick","ref":9},{"name":"accepted","ref":9},{"name":"objectNameChanged","ref":10}],"type":"object"}},"command":"lookup","refs":[{"handle":9,"type":"boolean","value":true},{"handle":8,"type":"boolean","value":false},{"handle":10,"properties":[],"type":"object"},{"handle":5,"type":"number","value":54},{"handle":4,"type":"string","value":""},{"handle":7,"type":"number","value":0},{"handle":6,"type":"number","value":1}],"request_seq":5,"running":false,"seq":6,"success":true,"type":"response"}
      
      d
      dNON-CRITICAL TIMEOUT
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-47061
          # Subject Branch Project Status CR V

          Activity

            People

              erikv Erik Verbruggen
              ulherman Ulf Hermann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes