aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-26 23:33:40 +0800
committerzelig <viktor.tron@gmail.com>2014-06-26 23:33:40 +0800
commit648c418fcd7a88fc48032c55c2dba87f6bdad8c7 (patch)
tree95e3701992b5757f4b392ff5b77cec971bafcc41
parent21d86ca486a88c936a1fe71f78d76c78df36a7eb (diff)
parentb89076faa2748a41031c4bc33bbdeba3e2effd01 (diff)
downloadgo-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.tar
go-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.tar.gz
go-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.tar.bz2
go-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.tar.lz
go-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.tar.xz
go-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.tar.zst
go-tangerine-648c418fcd7a88fc48032c55c2dba87f6bdad8c7.zip
Merge branch 'develop' of github.com:ethereum/go-ethereum into feature/logging
-rw-r--r--ethereal/assets/debugger/debugger.qml12
-rw-r--r--ethereal/ui/debugger.go40
-rw-r--r--ethereal/ui/gui.go4
3 files changed, 33 insertions, 23 deletions
diff --git a/ethereal/assets/debugger/debugger.qml b/ethereal/assets/debugger/debugger.qml
index 31e0eb781..d54c79523 100644
--- a/ethereal/assets/debugger/debugger.qml
+++ b/ethereal/assets/debugger/debugger.qml
@@ -10,9 +10,9 @@ ApplicationWindow {
visible: false
title: "IceCREAM"
minimumWidth: 1280
- minimumHeight: 900
+ minimumHeight: 700
width: 1290
- height: 900
+ height: 700
property alias codeText: codeEditor.text
property alias dataText: rawDataField.text
@@ -56,7 +56,7 @@ ApplicationWindow {
Rectangle {
color: "#00000000"
- height: 500
+ height: 330
anchors.left: parent.left
anchors.right: parent.right
@@ -208,6 +208,12 @@ ApplicationWindow {
}
text: "Next"
}
+ CheckBox {
+ id: breakEachLine
+ objectName: "breakEachLine"
+ text: "Break each instruction"
+ checked: true
+ }
}
}
diff --git a/ethereal/ui/debugger.go b/ethereal/ui/debugger.go
index 9d60c7587..85dd45563 100644
--- a/ethereal/ui/debugger.go
+++ b/ethereal/ui/debugger.go
@@ -26,7 +26,7 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
}
win := component.CreateWindow(nil)
- db := &Debugger{win, make(chan bool), make(chan bool), true, false}
+ db := &Debugger{win, make(chan bool), make(chan bool), true, false, true}
return &DebuggerWindow{engine: engine, win: win, lib: lib, Db: db}
}
@@ -59,6 +59,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
if !self.Db.done {
self.Db.Q <- true
}
+ self.Db.breakOnInstr = self.win.Root().ObjectByName("breakEachLine").Bool("checked")
defer func() {
if r := recover(); r != nil {
@@ -95,16 +96,20 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
self.win.Root().Call("setAsm", str)
}
- gas := ethutil.Big(gasStr)
- gasPrice := ethutil.Big(gasPriceStr)
- // Contract addr as test address
- keyPair := ethutil.GetKeyRing().Get(0)
- callerTx := ethchain.NewContractCreationTx(ethutil.Big(valueStr), gas, gasPrice, script)
+ var (
+ gas = ethutil.Big(gasStr)
+ gasPrice = ethutil.Big(gasPriceStr)
+ value = ethutil.Big(valueStr)
+ // Contract addr as test address
+ keyPair = ethutil.GetKeyRing().Get(0)
+ callerTx = ethchain.NewContractCreationTx(ethutil.Big(valueStr), gas, gasPrice, script)
+ )
callerTx.Sign(keyPair.PrivateKey)
state := self.lib.eth.BlockChain().CurrentBlock.State()
account := self.lib.eth.StateManager().TransState().GetAccount(keyPair.Address())
contract := ethchain.MakeContract(callerTx, state)
+ contract.Amount = value
callerClosure := ethchain.NewClosure(account, contract, script, state, gas, gasPrice)
block := self.lib.eth.BlockChain().CurrentBlock
@@ -164,6 +169,7 @@ type Debugger struct {
N chan bool
Q chan bool
done, interrupt bool
+ breakOnInstr bool
}
type storeVal struct {
@@ -190,16 +196,18 @@ func (d *Debugger) halting(pc int, op ethchain.OpCode, mem *ethchain.Memory, sta
d.win.Root().Call("setStorage", storeVal{fmt.Sprintf("% x", key), fmt.Sprintf("% x", node.Str())})
})
-out:
- for {
- select {
- case <-d.N:
- break out
- case <-d.Q:
- d.interrupt = true
- d.clearBuffers()
-
- return false
+ if d.breakOnInstr {
+ out:
+ for {
+ select {
+ case <-d.N:
+ break out
+ case <-d.Q:
+ d.interrupt = true
+ d.clearBuffers()
+
+ return false
+ }
}
}
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go
index 938037b90..83b1508e9 100644
--- a/ethereal/ui/gui.go
+++ b/ethereal/ui/gui.go
@@ -173,10 +173,6 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
gui.win = win
gui.uiLib.win = win
- db := &Debugger{gui.win, make(chan bool), make(chan bool), true, false}
- gui.lib.Db = db
- gui.uiLib.Db = db
-
return gui.win
}
func (gui *Gui) setInitialBlockChain() {