Merge pull request #918 from ethereum/remix_debug_fix

remix-debug small fixes
pull/5370/head
yann300 6 years ago committed by GitHub
commit 2ce2b77625
  1. 7
      remix-debug/src/Ethdebugger.js
  2. 9
      remix-lib/src/code/breakpointManager.js
  3. 1
      remix-solidity/src/compiler/compiler.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()) {

@ -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)
}
}
}

@ -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)

Loading…
Cancel
Save