aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vm_debug.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-12 20:26:01 +0800
committerobscuren <geffobscura@gmail.com>2014-12-12 20:26:01 +0800
commit05fd1dafe2c90d2acec4c2ea8619d8f656934a77 (patch)
treeb9441f2f610e5e8f9bc86cb50f98d9afea9a6ffa /vm/vm_debug.go
parent0d57ca486a4db9f2488df5f6be47eb9b09df2004 (diff)
downloaddexon-05fd1dafe2c90d2acec4c2ea8619d8f656934a77.tar.gz
dexon-05fd1dafe2c90d2acec4c2ea8619d8f656934a77.tar.zst
dexon-05fd1dafe2c90d2acec4c2ea8619d8f656934a77.zip
additional log
Diffstat (limited to 'vm/vm_debug.go')
-rw-r--r--vm/vm_debug.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index e9139ae19..8af1979b1 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -49,8 +49,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
closure := NewClosure(msg, caller, me, code, gas, price)
if self.env.Depth() == MaxCallDepth {
- closure.UseGas(gas)
-
+ //closure.UseGas(gas)
return closure.Return(nil), DepthError{}
}
@@ -885,7 +884,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
mem.Set(retOffset.Uint64(), retSize.Uint64(), ret)
}
- self.Printf("resume %x", closure.Address())
+ self.Printf("resume %x (%v)", closure.Address(), closure.Gas)
// Debug hook
if self.Dbg != nil {
le="color:#a52a35">type allocItem struct{ Addr, Balance *big.Int } type allocList []allocItem func (a allocList) Len() int { return len(a) } func (a allocList) Less(i, j int) bool { return a[i].Addr.Cmp(a[j].Addr) < 0 } func (a allocList) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func makelist(g *core.Genesis) allocList { a := make(allocList, 0, len(g.Alloc)) for addr, account := range g.Alloc { if len(account.Storage) > 0 || len(account.Code) > 0 || account.Nonce != 0 { panic(fmt.Sprintf("can't encode account %x", addr)) } a = append(a, allocItem{addr.Big(), account.Balance}) } sort.Sort(a) return a } func makealloc(g *core.Genesis) string { a := makelist(g) data, err := rlp.EncodeToBytes(a) if err != nil { panic(err) } return strconv.QuoteToASCII(string(data)) } func main() { if len(os.Args) != 2 { fmt.Fprintln(os.Stderr, "Usage: mkalloc genesis.json") os.Exit(1) } g := new(core.Genesis) file, err := os.Open(os.Args[1]) if err != nil { panic(err) } if err := json.NewDecoder(file).Decode(g); err != nil { panic(err) } fmt.Println("const allocData =", makealloc(g)) }