diff options
Diffstat (limited to 'ethereal/ui')
-rw-r--r-- | ethereal/ui/debugger.go | 6 | ||||
-rw-r--r-- | ethereal/ui/gui.go | 2 | ||||
-rw-r--r-- | ethereal/ui/ui_lib.go | 22 |
3 files changed, 27 insertions, 3 deletions
diff --git a/ethereal/ui/debugger.go b/ethereal/ui/debugger.go index 5b1fb50a2..342e3a7d0 100644 --- a/ethereal/ui/debugger.go +++ b/ethereal/ui/debugger.go @@ -65,6 +65,12 @@ func (self *DebuggerWindow) SetCode(code string) { func (self *DebuggerWindow) SetData(data string) { self.win.Set("dataText", data) } +func (self *DebuggerWindow) SetAsm(data string) { + dis := ethchain.Disassemble(ethutil.FromHex(data)) + for _, str := range dis { + self.win.Root().Call("setAsm", str) + } +} func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, dataStr string) { if !self.Db.done { diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 63ab028ab..32ff76b1a 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -54,7 +54,7 @@ func New(ethereum *eth.Ethereum) *Gui { } func (gui *Gui) Start(assetPath string) { - const version = "0.5.0 RC10" + const version = "0.5.0 RC11" defer gui.txDb.Close() diff --git a/ethereal/ui/ui_lib.go b/ethereal/ui/ui_lib.go index 998392525..9c4301ffe 100644 --- a/ethereal/ui/ui_lib.go +++ b/ethereal/ui/ui_lib.go @@ -24,8 +24,9 @@ type UiLib struct { connected bool assetPath string // The main application window - win *qml.Window - Db *Debugger + win *qml.Window + Db *Debugger + DbWindow *DebuggerWindow } func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib { @@ -88,9 +89,26 @@ func (ui *UiLib) ConnectToPeer(addr string) { func (ui *UiLib) AssetPath(p string) string { return path.Join(ui.assetPath, p) } +func (self *UiLib) StartDbWithContractAndData(contractHash, data string) { + dbWindow := NewDebuggerWindow(self) + object := self.eth.StateManager().CurrentState().GetStateObject(ethutil.FromHex(contractHash)) + if len(object.Script()) > 0 { + dbWindow.SetCode("0x" + ethutil.Hex(object.Script())) + } + dbWindow.SetData(data) + + dbWindow.Show() +} + +func (self *UiLib) StartDbWithCode(code string) { + dbWindow := NewDebuggerWindow(self) + dbWindow.SetCode("0x" + code) + dbWindow.Show() +} func (self *UiLib) StartDebugger() { dbWindow := NewDebuggerWindow(self) + //self.DbWindow = dbWindow dbWindow.Show() } |