|
|
|
@ -1,7 +1,6 @@ |
|
|
|
|
'use strict' |
|
|
|
|
var ButtonNavigator = require('./ButtonNavigator') |
|
|
|
|
var Slider = require('./Slider') |
|
|
|
|
var SoliditySlider = require('./SoliditySlider') |
|
|
|
|
var EventManager = require('../lib/eventManager') |
|
|
|
|
var SourceMappingDecoder = require('../util/sourceMappingDecoder') |
|
|
|
|
var yo = require('yo-yo') |
|
|
|
@ -28,26 +27,15 @@ function StepManager (_parent, _traceManager) { |
|
|
|
|
this.slider = new Slider(this.traceManager) |
|
|
|
|
this.slider.event.register('moved', this, function (step) { |
|
|
|
|
self.sliderMoved(step) |
|
|
|
|
self.soliditySlider.setValue(step) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.soliditySlider = new SoliditySlider(this.traceManager) |
|
|
|
|
|
|
|
|
|
this.parent.callTree.event.register('callTreeReady', () => { |
|
|
|
|
this.soliditySlider.setReducedTrace(this.parent.callTree.reducedTraceBySourceLocation) |
|
|
|
|
this.soliditySlider.event.register('moved', this, function (srcLocationStep) { |
|
|
|
|
var step = self.parent.callTree.reducedTraceBySourceLocation[srcLocationStep] |
|
|
|
|
self.sliderMoved(step) |
|
|
|
|
self.slider.setValue(step) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.slider.setReducedTrace(this.parent.callTree.reducedTrace) |
|
|
|
|
this.parent.vmDebugger.asmCode.event.register('hide', () => { |
|
|
|
|
this.soliditySlider.show() |
|
|
|
|
this.slider.hide() |
|
|
|
|
this.slider.setSolidityMode(true) |
|
|
|
|
}) |
|
|
|
|
this.parent.vmDebugger.asmCode.event.register('show', () => { |
|
|
|
|
this.soliditySlider.hide() |
|
|
|
|
this.slider.show() |
|
|
|
|
this.slider.setSolidityMode(false) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -79,7 +67,6 @@ StepManager.prototype.render = function () { |
|
|
|
|
return ( |
|
|
|
|
yo`<div>
|
|
|
|
|
${this.slider.render()} |
|
|
|
|
${this.soliditySlider.render()} |
|
|
|
|
${this.buttonNavigator.render()} |
|
|
|
|
</div>` |
|
|
|
|
) |
|
|
|
@ -87,14 +74,12 @@ StepManager.prototype.render = function () { |
|
|
|
|
|
|
|
|
|
StepManager.prototype.reset = function () { |
|
|
|
|
this.slider.setValue(0) |
|
|
|
|
this.soliditySlider.setValue(0) |
|
|
|
|
this.currentStepIndex = 0 |
|
|
|
|
this.buttonNavigator.reset() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StepManager.prototype.init = function () { |
|
|
|
|
this.slider.setValue(0) |
|
|
|
|
this.soliditySlider.setValue(0) |
|
|
|
|
this.changeState(0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -107,7 +92,6 @@ StepManager.prototype.jumpTo = function (step) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -127,7 +111,6 @@ StepManager.prototype.stepIntoForward = function () { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -140,7 +123,6 @@ StepManager.prototype.stepIntoBack = function () { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -150,7 +132,6 @@ StepManager.prototype.stepOverForward = function () { |
|
|
|
|
} |
|
|
|
|
var step = this.traceManager.findStepOverForward(this.currentStepIndex) |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -160,7 +141,6 @@ StepManager.prototype.stepOverBack = function () { |
|
|
|
|
} |
|
|
|
|
var step = this.traceManager.findStepOverBack(this.currentStepIndex) |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -170,7 +150,6 @@ StepManager.prototype.jumpNextCall = function () { |
|
|
|
|
} |
|
|
|
|
var step = this.traceManager.findNextCall(this.currentStepIndex) |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -180,7 +159,6 @@ StepManager.prototype.jumpOut = function () { |
|
|
|
|
} |
|
|
|
|
var step = this.traceManager.findStepOut(this.currentStepIndex) |
|
|
|
|
this.slider.setValue(step) |
|
|
|
|
this.soliditySlider.setValue(step) |
|
|
|
|
this.changeState(step) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|