@ -3,6 +3,7 @@ import QtQuick.Controls.Styles 1.1
import QtQuick . Controls 1.1
import QtQuick . Controls 1.1
import QtQuick . Dialogs 1.1
import QtQuick . Dialogs 1.1
import QtQuick . Layouts 1.1
import QtQuick . Layouts 1.1
import Qt . labs . settings 1.0
import "js/Debugger.js" as Debugger
import "js/Debugger.js" as Debugger
import "js/ErrorLocationFormater.js" as ErrorLocationFormater
import "js/ErrorLocationFormater.js" as ErrorLocationFormater
@ -20,7 +21,13 @@ Rectangle {
Debugger . moveSelection ( - 1 ) ;
Debugger . moveSelection ( - 1 ) ;
}
}
function update ( )
onVisibleChanged:
{
if ( visible )
forceActiveFocus ( ) ;
}
function update ( giveFocus )
{
{
if ( statusPane . result . successful )
if ( statusPane . result . successful )
{
{
@ -39,11 +46,13 @@ Rectangle {
errorDetail . text = errorInfo . errorDetail ;
errorDetail . text = errorInfo . errorDetail ;
errorLine . text = errorInfo . errorLine ;
errorLine . text = errorInfo . errorLine ;
}
}
if ( giveFocus )
forceActiveFocus ( ) ;
}
}
Connections {
Connections {
target: codeModel
target: codeModel
onCompilationComplete: update ( )
onCompilationComplete: update ( false )
}
}
Rectangle
Rectangle
@ -95,413 +104,452 @@ Rectangle {
}
}
}
}
Flickable {
Flickable {
property int firstColumnWidth: 17 0
property int firstColumnWidth: 18 0
property int secondColumnWidth: 250
property int secondColumnWidth: 250
id: debugScrollArea
id: debugScrollArea
flickableDirection: Flickable . VerticalFlick
flickableDirection: Flickable . VerticalFlick
anchors.fill: parent
anchors.fill: parent
contentHeight: machineStates . height + 300
contentHeight: 4000
contentWidth: machineStates . width
contentWidth: parent . width
Rectangle
GridLayout
{
{
property int sideMargin: 10
anchors.fill: parent
id: machineStates
ColumnLayout
anchors.top: parent . top
{
anchors.topMargin: 15
property int sideMargin: 10
anchors.left: parent . left ;
id: machineStates
anchors.leftMargin: machineStates . sideMargin
anchors.top: parent . top
anchors.right: parent . right ;
anchors.topMargin: 15
anchors.rightMargin: machineStates . sideMargin
anchors.left: parent . left ;
flow: GridLayout . TopToBottom
anchors.leftMargin: machineStates . sideMargin
rowSpacing: 15
anchors.right: parent . right ;
RowLayout {
anchors.rightMargin: machineStates . sideMargin
/ / s t e p b u t t o n + s l i d e r
anchors.fill: parent
spacing: machineStates . sideMargin
Layout.fillWidth: true
height: 27
Layout.fillHeight: true
width: debugPanel . width
RowLayout {
Rectangle
/ / s t e p b u t t o n + s l i d e r
{
id: buttonRow
height: parent . height
spacing: machineStates . sideMargin
color: "transparent"
height: 27
width: debugScrollArea . firstColumnWidth
Layout.fillWidth: true
RowLayout {
anchors.horizontalCenter: parent . horizontalCenter
id: jumpButtons
spacing: 3
StepActionImage
{
id: jumpOutBackAction ;
enabledStateImg: "qrc:/qml/img/jumpoutback.png"
disableStateImg: "qrc:/qml/img/jumpoutbackdisabled.png"
onClicked: Debugger . stepOutBack ( )
width: 25
height: 27
}
StepActionImage
Rectangle
{
{
id: jumpIntoBackAction
height: parent . height
enabledStateImg: "qrc:/qml/img/jumpintoback.png"
color: "transparent"
disableStateImg: "qrc:/qml/img/jumpintobackdisabled.png"
width: debugScrollArea . firstColumnWidth
onClicked: Debugger . stepIntoBack ( )
RowLayout {
width: 25
anchors.horizontalCenter: parent . horizontalCenter
height: 27
id: jumpButtons
}
spacing: 3
StepActionImage
{
id: jumpOutBackAction ;
enabledStateImg: "qrc:/qml/img/jumpoutback.png"
disableStateImg: "qrc:/qml/img/jumpoutbackdisabled.png"
onClicked: Debugger . stepOutBack ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Out Back" )
}
StepActionImage
StepActionImage
{
{
id: jumpOverBackAction
id: jumpIntoBackAction
enabledStateImg: "qrc:/qml/img/jumpoverback.png"
enabledStateImg: "qrc:/qml/img/jumpintoback.png"
disableStateImg: "qrc:/qml/img/jumpoverbackdisabled.png"
disableStateImg: "qrc:/qml/img/jumpintobackdisabled.png"
onClicked: Debugger . stepOverBack ( )
onClicked: Debugger . stepIntoBack ( )
width: 25
width: 28
height: 27
height: 30
}
buttonTooltip: qsTr ( "Step Into Back" )
}
StepActionImage
StepActionImage
{
{
id: jumpOverForwardAction
id: jumpOverBackAction
enabledStateImg: "qrc:/qml/img/jumpoverforward.png"
enabledStateImg: "qrc:/qml/img/jumpoverback.png"
disableStateImg: "qrc:/qml/img/jumpoverforwarddisabled.png"
disableStateImg: "qrc:/qml/img/jumpoverbackdisabled.png"
onClicked: Debugger . stepOverForward ( )
onClicked: Debugger . stepOverBack ( )
width: 25
width: 28
height: 27
height: 30
}
buttonTooltip: qsTr ( "Step Over Back" )
}
StepActionImage
StepActionImage
{
{
id: jumpIntoForwardAction
id: jumpOverForwardAction
enabledStateImg: "qrc:/qml/img/jumpintoforward.png"
enabledStateImg: "qrc:/qml/img/jumpoverforward.png"
disableStateImg: "qrc:/qml/img/jumpintoforwarddisabled.png"
disableStateImg: "qrc:/qml/img/jumpoverforwarddisabled.png"
onClicked: Debugger . stepIntoForward ( )
onClicked: Debugger . stepOverForward ( )
width: 25
width: 28
height: 27
height: 30
}
buttonTooltip: qsTr ( "Step Over Forward" )
}
StepActionImage
StepActionImage
{
{
id: jumpOutForwardAction
id: jumpIntoForwardAction
enabledStateImg: "qrc:/qml/img/jumpoutforward.png"
enabledStateImg: "qrc:/qml/img/jumpintoforward.png"
disableStateImg: "qrc:/qml/img/jumpoutforwarddisabled.png"
disableStateImg: "qrc:/qml/img/jumpintoforwarddisabled.png"
onClicked: Debugger . stepOutForward ( )
onClicked: Debugger . stepIntoForward ( )
width: 25
width: 28
height: 27
height: 30
buttonTooltip: qsTr ( "Step Into Forward" )
}
StepActionImage
{
id: jumpOutForwardAction
enabledStateImg: "qrc:/qml/img/jumpoutforward.png"
disableStateImg: "qrc:/qml/img/jumpoutforwarddisabled.png"
onClicked: Debugger . stepOutForward ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Out Forward" )
}
}
}
}
}
}
Rectangle {
Rectangle {
color: "transparent"
color: "transparent"
width: debugScrollArea . secondColumnWidth
Layout.fillWidth: true
height: parent . height
height: parent . height
Slider {
Slider {
id: statesSlider
id: statesSlider
anchors.fill: parent
anchors.fill: parent
tickmarksEnabled: true
tickmarksEnabled: true
stepSize: 1.0
stepSize: 1.0
onValueChanged: Debugger . jumpTo ( value ) ;
onValueChanged: Debugger . jumpTo ( value ) ;
style: SliderStyle {
style: SliderStyle {
groove: Rectangle {
groove: Rectangle {
implicitHeight: 3
implicitHeight: 3
color: "#7da4cd"
color: "#7da4cd"
radius: 8
radius: 8
}
}
handle: Rectangle {
handle: Rectangle {
anchors.centerIn: parent
anchors.centerIn: parent
color: control . pressed ? "white" : "lightgray"
color: control . pressed ? "white" : "lightgray"
border.color: "gray"
border.color: "gray"
border.width: 2
border.width: 2
implicitWidth: 10
implicitWidth: 10
implicitHeight: 10
implicitHeight: 10
radius: 12
radius: 12
}
}
}
}
}
}
}
}
}
}
RowLayout {
RowLayout {
/ / A s s e m b l y c o d e
/ / A s s e m b l y c o d e
width: debugPanel . width
id: assemblyCodeRow
height: 405
Layout.fillWidth: true
spacing: machineStates . sideMargin
height: 405
implicitHeight: 405
spacing: machineStates . sideMargin
Rectangle
Rectangle
{
{
width: debugScrollArea . firstColumnWidth
id: stateListContainer
height: parent . height
width: debugScrollArea . firstColumnWidth
border.width: 3
height: parent . height
border.color: "#deddd9"
border.width: 3
color: "white"
border.color: "#deddd9"
anchors.top: parent . top
color: "white"
ListView {
anchors.top: parent . top
anchors.fill: parent
ListView {
anchors.leftMargin: 3
anchors.fill: parent
anchors.rightMargin: 3
anchors.leftMargin: 3
anchors.topMargin: 3
anchors.rightMargin: 3
anchors.bottomMargin: 3
anchors.topMargin: 3
clip: true
anchors.bottomMargin: 3
id: statesList
clip: true
delegate: renderDelegate
id: statesList
highlight: highlightBar
delegate: renderDelegate
highlightFollowsCurrentItem: true
highlight: highlightBar
}
highlightFollowsCurrentItem: false
Component {
id: highlightBar
Rectangle {
radius: 4
height: statesList . currentItem . height
width: statesList . currentItem . width ;
color: "#4A90E2"
Behavior on y { SpringAnimation { spring: 2 ; damping: 0.1 } }
}
}
}
Component {
Component {
id: renderDelegate
id: highlightBar
RowLayout {
Rectangle {
id: wrapperItem
radius: 4
height: 20
height: statesList . currentItem . height
width: parent . width
width: statesList . currentItem . width ;
spacing: 5
y: statesList . currentItem . y
Text {
color: "#4A90E2"
anchors.left: parent . left
Behavior on y {
anchors.leftMargin: 10
PropertyAnimation { properties: "y" ; easing.type: Easing . InOutQuad ; duration: 50 }
width: 15
}
color: "#b2b3ae"
text: line . split ( ' ' ) [ 0 ]
font.pointSize: 9
id: id
wrapMode: Text . NoWrap
}
}
Text {
}
wrapMode: Text . NoWrap
color: parent . ListView . isCurrentItem ? "white" : "black"
Component {
text: line . replace ( line . split ( ' ' ) [ 0 ] , '' )
id: renderDelegate
anchors.left: id . right
RowLayout {
font.pointSize: 9
id: wrapperItem
height: 20
width: parent . width
spacing: 5
Text {
anchors.left: parent . left
anchors.leftMargin: 10
width: 15
color: "#b2b3ae"
text: line . split ( ' ' ) [ 0 ]
font.pointSize: 9
id: id
wrapMode: Text . NoWrap
}
Text {
wrapMode: Text . NoWrap
color: parent . ListView . isCurrentItem ? "white" : "black"
text: line . replace ( line . split ( ' ' ) [ 0 ] , '' )
anchors.left: id . right
font.pointSize: 9
}
}
}
}
}
}
}
}
ColumnLayout {
width: debugScrollArea . secondColumnWidth
height: parent . height
Rectangle {
Rectangle {
/ / I n f o
Layout.fillWidth: true
width: parent . width
height: parent . height / / - 2 * s t a t e L i s t C o n t a i n e r . b o r d e r . w i d t h
id: basicInfoColumn
height: 125
ColumnLayout
color: "transparent"
{
ColumnLayout {
spacing: 0
width: parent . width
width: parent . width
height: parent . height
anchors.fill: parent
spacing: 0
DebugBasicInfo {
DebugBasicInfo {
id: currentStep
id: currentStep
titleStr: qsTr ( "Current step" )
titleStr: qsTr ( "Current Step" )
Layout.fillWidth: true
height: 30
}
}
DebugBasicInfo {
DebugBasicInfo {
id: mem
id: mem
titleStr: qsTr ( "Adding memory" )
titleStr: qsTr ( "Adding Memory" )
Layout.fillWidth: true
height: 30
}
}
DebugBasicInfo {
DebugBasicInfo {
id: stepCost
id: stepCost
titleStr: qsTr ( "Step cost" )
titleStr: qsTr ( "Step Cost" )
Layout.fillWidth: true
height: 30
}
}
DebugBasicInfo {
DebugBasicInfo {
id: gasSpent
id: gasSpent
titleStr: qsTr ( "Total gas spent" )
titleStr: qsTr ( "Total Gas Spent" )
Layout.fillWidth: true
height: 30
}
DebugInfoList
{
Layout.fillHeight: true
Layout.fillWidth: true
id: stack
collapsible: false
title : qsTr ( "Stack" )
itemDelegate: Item {
id: renderedItem
height: 25
width: parent . width
RowLayout
{
anchors.fill: parent
Rectangle
{
id: indexColumn
color: "#f7f7f7"
Layout.fillWidth: true
Layout.minimumWidth: 30
Layout.preferredWidth: 30
Layout.maximumWidth: 30
Layout.minimumHeight: parent . height
Text {
anchors.centerIn: parent
anchors.leftMargin: 5
font.family: "monospace"
color: "#4a4a4a"
text: model . index ;
font.pointSize: 9
}
}
Rectangle
{
anchors.left: indexColumn . right
Layout.fillWidth: true
Layout.minimumWidth: 15
Layout.preferredWidth: 15
Layout.maximumWidth: 60
Layout.minimumHeight: parent . height
Text {
anchors.left: parent . left
anchors.leftMargin: 5
font.family: "monospace"
anchors.verticalCenter: parent . verticalCenter
color: "#4a4a4a"
text: modelData
font.pointSize: 9
}
}
}
Rectangle {
id: separator
width: parent . width ;
height: 1 ;
color: "#cccccc"
anchors.bottom: parent . bottom
}
}
}
}
}
}
}
}
}
Rectangle {
SplitView
/ / S t a c k
{
height: 275
id: splitInfoList
width: parent . width
Layout.fillHeight: true
color: "transparent"
Layout.fillWidth: true
Settings {
id: splitSettings
property alias storageHeightSettings: storageRect . height
property alias memoryDumpHeightSettings: memoryRect . height
property alias callDataHeightSettings: callDataRect . height
}
orientation: Qt . Vertical
width: debugPanel . width - 2 * machineStates . sideMargin
Rectangle
{
id: storageRect
width: parent . width
Layout.minimumHeight: 25
Layout.maximumHeight: 223
height: 25
DebugInfoList
DebugInfoList
{
{
id: stack
id: storage
width: parent . width
anchors.fill: parent
height: parent . height
collapsible: true
collapsible: false
title : qsTr ( "Storage" )
title : qsTr ( "Stack" )
itemDelegate:
itemDelegate: Item {
Item {
id: renderedItem
height: 27
height: 27
width: parent . width
width: parent . width ;
RowLayout
RowLayout
{
{
anchors.fill: parent
id: row
width: parent . width
height: 26
Rectangle
Rectangle
{
{
id: indexColumn
color: "#f7f7f7"
color: "#f7f7f7"
Layout.fillWidth: true
Layout.fillWidth: true
Layout.minimumWidth: 30
Layout.minimumWidth: parent . width / 2
Layout.preferredWidth: 30
Layout.preferredWidth: parent . width / 2
Layout.maximumWidth: 30
Layout.maximumWidth: parent . width / 2
Layout.minimumHeight: parent . height
Layout.minimumHeight: parent . height
Layout.maximumHeight: parent . height
Text {
Text {
anchors.centerIn: parent
anchors.verticalCenter: parent . verticalCenter
anchors.left: parent . left
font.family: "monospace"
anchors.leftMargin: 5
anchors.leftMargin: 5
color: "#8b8b8b"
color: "#4a4a4a "
text: model . index ;
text: modelData . split ( ' ' ) [ 0 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
font.pointSize: 9
}
}
}
}
Rectangle
Rectangle
{
{
anchors.left: indexColumn . right
color: "transparent"
Layout.fillWidth: true
Layout.fillWidth: true
Layout.minimumWidth: 15
Layout.minimumWidth: parent . width / 2
Layout.preferredWidth: 15
Layout.preferredWidth: parent . width / 2
Layout.maximumWidth: 60
Layout.maximumWidth: parent . width / 2
Layout.minimumHeight: parent . height
Layout.minimumHeight: parent . height
Layout.maximumHeight: parent . height
Text {
Text {
anchors.left: parent . left
anchors.leftMargin: 5
anchors.leftMargin: 5
width: parent . width - 5
wrapMode: Text . Wrap
anchors.left: parent . left
font.family: "monospace"
anchors.verticalCenter: parent . verticalCenter
anchors.verticalCenter: parent . verticalCenter
color: "#8b8b8b"
color: "#4a4a4a "
text: modelData
text: modelData . split ( ' ' ) [ 1 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
font.pointSize: 9
}
}
}
}
}
}
Rectangle {
Rectangle {
id: separator
anchors.top: row . bottom
width: parent . width ;
width: parent . width ;
height: 1 ;
height: 1 ;
color: "#cccccc"
color: "#cccccc"
anchors.bottom: parent . bottom
anchors.bottom: parent . bottom
}
}
}
}
}
}
}
}
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
DebugInfoList
Rectangle
{
id: storage
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
collapsible: true
title : qsTr ( "Storage" )
itemDelegate:
Item {
height: 27
width: parent . width ;
RowLayout
{
{
id: row
id: memoryRect ;
height: 25
width: parent . width
width: parent . width
height: 26
Layout.minimumHeight: 25
Rectangle
Layout.maximumHeight: 223
{
DebugInfoList {
color: "#f7f7f7"
id: memoryDump
Layout.fillWidth: true
anchors.fill: parent
Layout.minimumWidth: parent . width / 2
collapsible: true
Layout.preferredWidth: parent . width / 2
title: qsTr ( "Memory Dump" )
Layout.maximumWidth: parent . width / 2
itemDelegate:
Layout.minimumHeight: parent . height
Item {
Layout.maximumHeight: parent . height
height: 29
Text {
width: parent . width - 3 ;
anchors.verticalCenter: parent . verticalCenter
ItemDelegateDataDump { }
anchors.left: parent . left
anchors.leftMargin: 5
color: "#8b8b8b"
text: modelData . split ( ' ' ) [ 0 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
}
}
}
}
Rectangle
}
{
color: "transparent"
Rectangle
Layout.fillWidth: true
{
Layout.minimumWidth: parent . width / 2
id: callDataRect
Layout.preferredWidth: parent . width / 2
height: 25
Layout.maximumWidth: parent . width / 2
width: parent . width
Layout.minimumHeight: parent . height
Layout.minimumHeight: 25
Layout.maximumHeight: parent . height
Layout.maximumHeight: 223
Text {
DebugInfoList {
anchors.leftMargin: 5
id: callDataDump
width: parent . width - 5
anchors.fill: parent
wrapMode: Text . Wrap
collapsible: true
anchors.left: parent . left
title: qsTr ( "Call Data" )
anchors.verticalCenter: parent . verticalCenter
itemDelegate:
color: "#8b8b8b"
Item {
text: modelData . split ( ' ' ) [ 1 ] . substring ( 0 , 10 ) ;
height: 29
font.pointSize: 9
width: parent . width - 3 ;
ItemDelegateDataDump { }
}
}
}
}
}
}
Rectangle
Rectangle {
{
anchors.top: row . bottom
width: parent . width
width: parent . width ;
Layout.minimumHeight: 25
height: 1 ;
color: "transparent"
color: "#cccccc"
}
anchors.bottom: parent . bottom
}
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
DebugInfoList {
id: memoryDump
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
collapsible: true
title: qsTr ( "Memory Dump" )
itemDelegate:
Item {
height: 29
width: parent . width - 3 ;
ItemDelegateDataDump { }
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
DebugInfoList {
id: callDataDump
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
collapsible: true
title: qsTr ( "Call data" )
itemDelegate:
Item {
height: 29
width: parent . width - 3 ;
ItemDelegateDataDump { }
}
}
}
}
}
}