aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/assets/debugger/debugger.qml
blob: b7d954e73f89eedf7747a0dc7139532f0c376b2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import QtQuick 2.0
import QtQuick.Controls 1.0;
import QtQuick.Layouts 1.0;
import QtQuick.Dialogs 1.0;
import QtQuick.Window 2.1;
import QtQuick.Controls.Styles 1.1
import Ethereum 1.0

ApplicationWindow {
    id: debugWindow
    visible: false
    title: "Debugger"
    minimumWidth: 600
    minimumHeight: 600
    width: 800
    height: 600

    SplitView {
        anchors.fill: parent
        property var asmModel: ListModel {
            id: asmModel
        }
        TableView {
            id: asmTableView
            width: 200
            TableViewColumn{ role: "value" ; title: "" ; width: 100 }
            model: asmModel
        }

        Rectangle {
            anchors.left: asmTableView.right
            anchors.right: parent.right
            SplitView {
                orientation: Qt.Vertical
                anchors.fill: parent

                TableView {
                    property var memModel: ListModel {
                        id: memModel
                    }
                    height: parent.height/2
                    width: parent.width
                    TableViewColumn{ id:mnumColmn ; role: "num" ; title: "#" ; width: 50}
                    TableViewColumn{ role: "value" ; title: "Memory" ; width: 750}
                    model: memModel
                }

                SplitView {
                    orientation: Qt.Horizontal
                    TableView {
                        property var debuggerLog: ListModel {
                            id: debuggerLog
                        }
                        TableViewColumn{ role: "value"; title: "Debug messages" }
                        model: debuggerLog
                    }
                    TableView {
                        property var stackModel: ListModel {
                            id: stackModel
                        }
                        height: parent.height/2
                        width: parent.width
                        TableViewColumn{ role: "value" ; title: "Stack" ; width: 200 }
                        model: stackModel
                    }
                }
            }
        }
    }
    statusBar: StatusBar {
        RowLayout {
            anchors.fill: parent
            Button {
                property var enabled: true
                id: debugNextButton
                onClicked: {
                    //db.next()
                }
                text: "Next"
            }
        }
    }

    function setAsm(asm) {
        asmModel.append({asm: asm})
    }

    function setInstruction(num) {
        asmTableView.selection.clear()
        asmTableView.selection.select(num-1)
    }

    function clearAsm() {
        asmModel.clear()
    }

    function setMem(mem) {
        memModel.append({num: mem.num, value: mem.value})
    }
    function clearMem(){
        memModel.clear()
    }

    function setStack(stack) {
        stackModel.append({value: stack})
    }
    function addDebugMessage(message){
        debuggerLog.append({value: message})
    }

    function clearStack() {
        stackModel.clear()
    }
}