Commit b63eeda4 authored by Iuri Matias's avatar Iuri Matias Committed by yann300

refactor debug to have a loading callback and move the actual debug call to it

parent 3126c729
...@@ -76,7 +76,7 @@ Debugger.prototype.registerAndHighlightCodeItem = function (index) { ...@@ -76,7 +76,7 @@ Debugger.prototype.registerAndHighlightCodeItem = function (index) {
}) })
} }
Debugger.prototype.debug = function (parent) { Debugger.prototype.debug = function (parent, tx, loadingCb) {
const self = this const self = this
this.step_manager = new StepManager(this.debugger, this.debugger.traceManager) this.step_manager = new StepManager(this.debugger, this.debugger.traceManager)
parent.event.register('indexChanged', this, (index) => { parent.event.register('indexChanged', this, (index) => {
...@@ -92,6 +92,9 @@ Debugger.prototype.debug = function (parent) { ...@@ -92,6 +92,9 @@ Debugger.prototype.debug = function (parent) {
}) })
this.vmDebuggerLogic = new VmDebuggerLogic(parent, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree) this.vmDebuggerLogic = new VmDebuggerLogic(parent, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree)
loadingCb()
this.debugger.debug(tx)
} }
module.exports = Debugger module.exports = Debugger
...@@ -166,16 +166,15 @@ class DebuggerUI { ...@@ -166,16 +166,15 @@ class DebuggerUI {
// still here because tx is being reffered in children // still here because tx is being reffered in children
this.tx = tx this.tx = tx
this.transactionDebugger.debug(this) this.transactionDebugger.debug(this, tx, () => {
this.stepManager = new StepManagerUI(this.transactionDebugger.step_manager) self.stepManager = new StepManagerUI(this.transactionDebugger.step_manager)
this.stepManager.event.register('stepChanged', this, function (stepIndex) { self.stepManager.event.register('stepChanged', this, function (stepIndex) {
self.stepChanged(stepIndex) self.stepChanged(stepIndex)
}) })
this.vmDebugger = new VmDebugger(this.transactionDebugger.vmDebuggerLogic)
this.andAddVmDebugger()
this.transactionDebugger.debugger.debug(tx) self.vmDebugger = new VmDebugger(this.transactionDebugger.vmDebuggerLogic)
self.andAddVmDebugger()
})
} }
debug (txHash) { debug (txHash) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment