|
|
@ -3,10 +3,10 @@ var EventManager = remixLib.EventManager |
|
|
|
|
|
|
|
|
|
|
|
class DebuggerStepManager { |
|
|
|
class DebuggerStepManager { |
|
|
|
|
|
|
|
|
|
|
|
constructor (_debugger, _traceManager) { |
|
|
|
constructor (_debugger, traceManager) { |
|
|
|
this.event = new EventManager() |
|
|
|
this.event = new EventManager() |
|
|
|
this.parent = _debugger |
|
|
|
this.debugger = _debugger |
|
|
|
this.traceManager = _traceManager |
|
|
|
this.traceManager = traceManager |
|
|
|
this.currentStepIndex = 0 |
|
|
|
this.currentStepIndex = 0 |
|
|
|
this.traceLength = 0 |
|
|
|
this.traceLength = 0 |
|
|
|
this.revertionPoint = null |
|
|
|
this.revertionPoint = null |
|
|
@ -17,7 +17,7 @@ class DebuggerStepManager { |
|
|
|
listenToEvents () { |
|
|
|
listenToEvents () { |
|
|
|
const self = this |
|
|
|
const self = this |
|
|
|
|
|
|
|
|
|
|
|
this.parent.event.register('newTraceLoaded', this, function () { |
|
|
|
this.debugger.event.register('newTraceLoaded', this, function () { |
|
|
|
self.traceManager.getLength(function (error, newLength) { |
|
|
|
self.traceManager.getLength(function (error, newLength) { |
|
|
|
if (error) { |
|
|
|
if (error) { |
|
|
|
return console.log(error) |
|
|
|
return console.log(error) |
|
|
@ -30,9 +30,9 @@ class DebuggerStepManager { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.parent.callTree.event.register('callTreeReady', () => { |
|
|
|
this.debugger.callTree.event.register('callTreeReady', () => { |
|
|
|
if (self.parent.callTree.functionCallStack.length) { |
|
|
|
if (self.debugger.callTree.functionCallStack.length) { |
|
|
|
self.jumpTo(self.parent.callTree.functionCallStack[0]) |
|
|
|
self.jumpTo(self.debugger.callTree.functionCallStack[0]) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
@ -133,14 +133,11 @@ class DebuggerStepManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
jumpNextBreakpoint () { |
|
|
|
jumpNextBreakpoint () { |
|
|
|
// TODO: this is the same currentStepIndex var but currently coupled all the way up to EthDebuggerUI
|
|
|
|
this.debugger.breakpointManager.jumpNextBreakpoint(this.currentStepIndex, true) |
|
|
|
// the trigger in updateStep is updating it in EthDebuggerUI
|
|
|
|
|
|
|
|
// the refactor should remove it
|
|
|
|
|
|
|
|
this.parent.breakpointManager.jumpNextBreakpoint(this.currentStepIndex, true) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
jumpPreviousBreakpoint () { |
|
|
|
jumpPreviousBreakpoint () { |
|
|
|
this.parent.breakpointManager.jumpPreviousBreakpoint(this.currentStepIndex, true) |
|
|
|
this.debugger.breakpointManager.jumpPreviousBreakpoint(this.currentStepIndex, true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|