diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-26 16:37:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-26 16:37:48 +0800 |
commit | b3367ec0e3e69694481cccd9335a63d2c559a543 (patch) | |
tree | 06ea78faf1e73d8a43958e5ac5db0fa75fa7a61b /ethereal/ui/debugger.go | |
parent | 1268413ba7f7a3bc0c60fbe47e582864b2de8ccd (diff) | |
download | go-tangerine-b3367ec0e3e69694481cccd9335a63d2c559a543.tar.gz go-tangerine-b3367ec0e3e69694481cccd9335a63d2c559a543.tar.zst go-tangerine-b3367ec0e3e69694481cccd9335a63d2c559a543.zip |
Added option to not break eachline
Diffstat (limited to 'ethereal/ui/debugger.go')
-rw-r--r-- | ethereal/ui/debugger.go | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/ethereal/ui/debugger.go b/ethereal/ui/debugger.go index 9d60c7587..f49741e09 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 { @@ -164,6 +165,7 @@ type Debugger struct { N chan bool Q chan bool done, interrupt bool + breakOnInstr bool } type storeVal struct { @@ -190,16 +192,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 + } } } |