move step manager into debugger

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 097f37c78d
commit 16f98a7412
  1. 6
      src/app/debugger/debugger/debugger.js
  2. 14
      src/app/debugger/debuggerUI.js

@ -3,6 +3,8 @@ var Ethdebugger = require('remix-debug').EthDebugger
var remixLib = require('remix-lib')
var EventManager = remixLib.EventManager
var StepManager = require('./stepManager')
function Debugger (options) {
var self = this
this.event = new EventManager()
@ -73,4 +75,8 @@ Debugger.prototype.registerAndHighlightCodeItem = function (index) {
})
}
Debugger.prototype.debug = function (parent) {
this.step_manager = new StepManager(parent, this.debugger.traceManager)
}
module.exports = Debugger

@ -3,7 +3,6 @@ var StepManagerUI = require('./debuggerUI/StepManager')
var VmDebugger = require('./debuggerUI/VmDebugger')
var Debugger = require('./debugger/debugger')
var StepManager = require('./debugger/stepManager')
var VmDebuggerLogic = require('./VmDebugger')
var SourceHighlighter = require('../editor/sourceHighlighter')
@ -166,6 +165,12 @@ class DebuggerUI {
this.tx = tx
this.transactionDebugger.debug(this)
this.stepManager = new StepManagerUI(this.transactionDebugger.step_manager)
this.stepManager.event.register('stepChanged', this, function (stepIndex) {
self.stepChanged(stepIndex)
})
this.debugger.codeManager.event.register('changed', this, (code, address, instIndex) => {
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, this.currentStepIndex, this.debugger.solidityProxy.contracts, (error, sourceLocation) => {
if (!error) {
@ -174,12 +179,6 @@ class DebuggerUI {
})
})
this.transactionDebugger.step_manager = new StepManager(this, this.transactionDebugger.debugger.traceManager)
this.stepManager = new StepManagerUI(this.transactionDebugger.step_manager)
this.stepManager.event.register('stepChanged', this, function (stepIndex) {
self.stepChanged(stepIndex)
})
this.vmDebuggerLogic = new VmDebuggerLogic(this, this.transactionDebugger.debugger.traceManager, this.transactionDebugger.debugger.codeManager, this.transactionDebugger.debugger.solidityProxy, this.transactionDebugger.debugger.callTree)
this.vmDebugger = new VmDebugger(this.vmDebuggerLogic)
this.andAddVmDebugger()
@ -203,7 +202,6 @@ class DebuggerUI {
self.txBrowser.load(tx)
self.getTxAndDebug(null, tx)
}
})
}

Loading…
Cancel
Save