diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-20 22:49:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-20 22:49:12 +0800 |
commit | 9845029a7535672746139084138f3e894e604e44 (patch) | |
tree | 3503d094eac24e63108938a37008a2eab3b3528d | |
parent | 375cc67ba6dbc57e69aa594a6ac26ebc9b3a713a (diff) | |
download | dexon-9845029a7535672746139084138f3e894e604e44.tar dexon-9845029a7535672746139084138f3e894e604e44.tar.gz dexon-9845029a7535672746139084138f3e894e604e44.tar.bz2 dexon-9845029a7535672746139084138f3e894e604e44.tar.lz dexon-9845029a7535672746139084138f3e894e604e44.tar.xz dexon-9845029a7535672746139084138f3e894e604e44.tar.zst dexon-9845029a7535672746139084138f3e894e604e44.zip |
StdVm by default
-rw-r--r-- | cmd/mist/assets/debugger/debugger.qml | 3 | ||||
-rw-r--r-- | cmd/mist/debugger.go | 3 | ||||
-rw-r--r-- | cmd/mist/ui_lib.go | 6 | ||||
-rw-r--r-- | core/execution.go | 2 | ||||
-rw-r--r-- | vm/vm.go | 6 | ||||
-rw-r--r-- | vm/vm_jit.go | 2 |
6 files changed, 14 insertions, 8 deletions
diff --git a/cmd/mist/assets/debugger/debugger.qml b/cmd/mist/assets/debugger/debugger.qml index b30d20e6b..5566e8fca 100644 --- a/cmd/mist/assets/debugger/debugger.qml +++ b/cmd/mist/assets/debugger/debugger.qml @@ -19,7 +19,7 @@ ApplicationWindow { property alias dataText: rawDataField.text onClosing: { - dbg.Stop() + //dbg.Stop() } menuBar: MenuBar { @@ -353,6 +353,7 @@ ApplicationWindow { ComboBox { + visible: false id: snippets anchors.right: parent.right model: ListModel { diff --git a/cmd/mist/debugger.go b/cmd/mist/debugger.go index 9df140ab1..58d8da7b2 100644 --- a/cmd/mist/debugger.go +++ b/cmd/mist/debugger.go @@ -267,6 +267,9 @@ type storeVal struct { Key, Value string } +func (self *Debugger) Step(evm vm.VirtualMachine, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, context *vm.Context) { +} + func (self *Debugger) BreakHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool { self.main.Logln("break on instr:", pc) diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index f3559183e..c88c4dab6 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -212,16 +212,16 @@ func (self *UiLib) StartDbWithContractAndData(contractHash, data string) { dbWindow := NewDebuggerWindow(self) object := self.eth.ChainManager().State().GetStateObject(ethutil.Hex2Bytes(contractHash)) if len(object.Code) > 0 { - dbWindow.SetCode("0x" + ethutil.Bytes2Hex(object.Code)) + dbWindow.SetCode(ethutil.Bytes2Hex(object.Code)) } - dbWindow.SetData("0x" + data) + dbWindow.SetData(data) dbWindow.Show() } func (self *UiLib) StartDbWithCode(code string) { dbWindow := NewDebuggerWindow(self) - dbWindow.SetCode("0x" + code) + dbWindow.SetCode(code) dbWindow.Show() } diff --git a/core/execution.go b/core/execution.go index f1e6f83f5..cad4e84aa 100644 --- a/core/execution.go +++ b/core/execution.go @@ -33,7 +33,7 @@ func (self *Execution) Call(codeAddr []byte, caller vm.ContextRef) ([]byte, erro func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret []byte, err error) { env := self.env - evm := vm.New(env, vm.StdVmTy) + evm := vm.New(env) if env.Depth() == vm.MaxCallDepth { caller.ReturnGas(self.Gas, self.price) @@ -17,7 +17,6 @@ type Vm struct { err error - // Debugging Dbg Debugger BreakPoints []int64 @@ -27,7 +26,7 @@ type Vm struct { Recoverable bool } -func NewVm(env Environment) *Vm { +func New(env Environment) *Vm { lt := LogTyPretty if ethutil.Config.Diff { lt = LogTyDiff @@ -111,6 +110,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I op = context.GetOp(pc) self.Printf("(pc) %-3d -o- %-14s (m) %-4d (s) %-4d ", pc, op.String(), mem.Len(), stack.Len()) + if self.Dbg != nil { + //self.Dbg.Step(self, op, mem, stack, context) + } newMemSize, gas := self.calculateGasAndSize(context, caller, op, statedb, mem, stack) diff --git a/vm/vm_jit.go b/vm/vm_jit.go index 1cb9652af..0882bcf0c 100644 --- a/vm/vm_jit.go +++ b/vm/vm_jit.go @@ -8,7 +8,7 @@ type JitVm struct { } func NewJitVm(env Environment) *JitVm { - backupVm := NewVm(env) + backupVm := New(env) return &JitVm{env: env, backup: backupVm} } |