aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-04 21:32:10 +0800
committerobscuren <geffobscura@gmail.com>2014-07-04 21:32:10 +0800
commit90eb4f1939f7b0389d5784b889cc0e5d2b3451f7 (patch)
treec812cf882cb5a22ea7ffd4a061be2ac286dcfa58 /ethchain/vm.go
parent23b5b5fa36530eb82543d7d877f8e9e1900232cf (diff)
downloaddexon-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.gz
dexon-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.tar.zst
dexon-90eb4f1939f7b0389d5784b889cc0e5d2b3451f7.zip
Debug output, minor fixes and tweaks
* Script compile length fix * Transition fix
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r--ethchain/vm.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index 3a7aa8c58..cfedadb08 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -56,6 +56,7 @@ type Vm struct {
Hook DebugHook
BreakPoints []int64
Stepping bool
+ Fn string
}
type DebugHook func(step int, op OpCode, mem *Memory, stack *Stack, stateObject *StateObject) bool
@@ -107,7 +108,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
}
}()
- vmlogger.Debugf("(~) %x gas: %v (d) %x\n", closure.object.Address(), closure.Gas, closure.Args)
+ vmlogger.Debugf("(%s) %x gas: %v (d) %x\n", vm.Fn, closure.object.Address(), closure.Gas, closure.Args)
var (
op OpCode
@@ -577,7 +578,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
stack.Push(val.BigInt())
- vm.Printf(" {0x%x} 0x%x", loc.Bytes(), val.Bytes())
+ vm.Printf(" {0x%x : 0x%x}", loc.Bytes(), val.Bytes())
case SSTORE:
require(2)
val, loc := stack.Popn()
@@ -586,7 +587,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
// Add the change to manifest
vm.state.manifest.AddStorageChange(closure.Object(), loc.Bytes(), val)
- vm.Printf(" {0x%x} 0x%x", loc, val)
+ vm.Printf(" {0x%x : 0x%x}", loc, val)
case JUMP:
require(1)
pc = stack.Pop()