Added wip debugger

This commit is contained in:
obscuren
2014-04-11 12:50:31 -04:00
parent 1e94cb5286
commit 3238894a3b
4 changed files with 166 additions and 49 deletions

View File

@@ -194,20 +194,32 @@ ApplicationWindow {
width: parent.width /2
}
Button {
id: txButton
text: "Send"
onClicked: {
//this.enabled = false
var res = eth.createTx(txRecipient.text, txValue.text, txGas.text, txGasPrice.text, codeView.text)
if(res[1]) {
txOutput.text = "Output:\n" + res[1].error()
} else {
txOutput.text = "Output:\n" + res[0]
RowLayout {
Button {
id: txButton
text: "Send"
onClicked: {
//this.enabled = false
var res = eth.createTx(txRecipient.text, txValue.text, txGas.text, txGasPrice.text, codeView.text)
if(res[1]) {
txOutput.text = "Output:\n" + res[1].error()
} else {
txOutput.text = "Output:\n" + res[0]
}
txOutput.visible = true
}
}
Button {
id: debugButton
text: "Debug"
onClicked: {
var res = ui.debugTx(txRecipient.text, txValue.text, txGas.text, txGasPrice.text, codeView.text)
debugWindow.visible = true
}
txOutput.visible = true
}
}
TextArea {
id: txOutput
visible: false
@@ -409,6 +421,83 @@ ApplicationWindow {
}
Window {
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
}
TableView {
property var stackModel: ListModel {
id: stackModel
}
height: parent.height/2
width: parent.width
TableViewColumn{ role: "value" ; title: "Stack" ; width: parent.width }
model: stackModel
}
}
}
}
}
function setAsm(asm) {
//for(var i = 0; i < asm.length; i++) {
asmModel.append({asm: asm})
//}
}
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 clearStack() {
stackModel.clear()
}
function loadPlugin(name) {
console.log("Loading plugin" + name)
mainView.addPlugin(name)