diff --git a/remix-debug/src/Ethdebugger.js b/remix-debug/src/Ethdebugger.js index d5fcd8afbb..e8862fb63c 100644 --- a/remix-debug/src/Ethdebugger.js +++ b/remix-debug/src/Ethdebugger.js @@ -36,7 +36,8 @@ function Ethdebugger (opts) { this.opts = opts || {} if (!this.opts.compilationResult) this.opts.compilationResult = () => { return null } - this.web3 = opts.web3 + this.executionContext = opts.executionContext || executionContext + this.web3 = opts.web3 || this.executionContext.web3 this.event = new EventManager() @@ -181,7 +182,7 @@ Ethdebugger.prototype.switchProvider = function (type) { self.web3 = obj self.setManagers() // self.traceManager.web3 = self.web3 - executionContext.detectNetwork((error, network) => { + self.executionContext.detectNetwork((error, network) => { if (error || !network) { self.web3Debug = obj self.web3 = obj @@ -209,7 +210,6 @@ Ethdebugger.prototype.debug = function (tx) { Ethdebugger.prototype.unLoad = function () { this.traceManager.init() this.codeManager.clear() - this.stepManager.reset() this.event.trigger('traceUnloaded') } @@ -225,7 +225,6 @@ Ethdebugger.prototype.debug = function (tx) { this.tx = tx var self = this this.traceManager.resolveTrace(tx, function (error, result) { - console.log('trace loaded ' + result) if (result) { self.event.trigger('newTraceLoaded', [self.traceManager.trace]) if (self.breakpointManager && self.breakpointManager.hasBreakpoint()) { diff --git a/remix-lib/src/code/breakpointManager.js b/remix-lib/src/code/breakpointManager.js index 73b53f5479..8be1ac451b 100644 --- a/remix-lib/src/code/breakpointManager.js +++ b/remix-lib/src/code/breakpointManager.js @@ -15,12 +15,13 @@ class BreakpointManager { * @param {Object} _debugger - type of EthDebugger * @return {Function} _locationToRowConverter - function implemented by editor which return a column/line position for a char source location */ - constructor (_debugger, _locationToRowConverter) { + constructor (_debugger, _locationToRowConverter, _jumpToCallback) { this.event = new EventManager() this.debugger = _debugger this.breakpoints = {} this.locationToRowConverter = _locationToRowConverter this.previousLine + this.jumpToCallback = _jumpToCallback || (() => {}) } /** @@ -67,7 +68,7 @@ class BreakpointManager { sourceLocation.start + sourceLocation.length >= previousSourceLocation.start + previousSourceLocation.length)) { return false } else { - if (self.debugger.stepManager) self.debugger.stepManager.jumpTo(currentStep) + self.jumpToCallback(currentStep) self.event.trigger('breakpointHit', [sourceLocation, currentStep]) return true } @@ -108,9 +109,9 @@ class BreakpointManager { this.event.trigger('NoBreakpointHit', []) if (this.debugger.stepManager && defaultToLimit) { if (direction === -1) { - this.debugger.stepManager.jumpTo(0) + this.jumpToCallback(0) } else if (direction === 1) { - this.debugger.stepManager.jumpTo(this.debugger.traceManager.trace.length - 1) + this.jumpToCallback(this.debugger.traceManager.trace.length - 1) } } } diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 4238cb6a0f..849b7b5489 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -210,6 +210,7 @@ function Compiler (handleImportCall) { self.event.trigger('compilationFinished', [false, data, source]) } else if (missingInputs !== undefined && missingInputs.length > 0) { // try compiling again with the new set of inputs + internalCompile(source.sources, source.target, missingInputs) } else { data = updateInterface(data)