fix fixes for remix-debug integration

pull/5370/head
Iuri Matias 6 years ago
parent f5a11a4666
commit cb61b40c37
  1. 10
      remix-debug/src/Ethdebugger.js
  2. 4
      remix-lib/src/trace/traceManager.js
  3. 2
      remix-lib/src/trace/traceRetriever.js
  4. 3
      remix-lib/src/web3Provider/web3VmProvider.js
  5. 3
      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()
@ -55,6 +56,7 @@ function Ethdebugger (opts) {
}
Ethdebugger.prototype.setManagers = function () {
console.log("remix-debug: setManagers");
this.traceManager = new TraceManager({web3: this.web3})
this.codeManager = new CodeManager(this.traceManager)
this.solidityProxy = new SolidityProxy(this.traceManager, this.codeManager)
@ -181,7 +183,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
@ -198,6 +200,7 @@ Ethdebugger.prototype.switchProvider = function (type) {
}
Ethdebugger.prototype.debug = function (tx) {
debugger;
this.setCompilationResult(this.opts.compilationResult())
if (tx instanceof Object) {
this.txBrowser.load(tx.hash)
@ -209,7 +212,6 @@ Ethdebugger.prototype.debug = function (tx) {
Ethdebugger.prototype.unLoad = function () {
this.traceManager.init()
this.codeManager.clear()
this.stepManager.reset()
this.event.trigger('traceUnloaded')
}
@ -224,8 +226,10 @@ Ethdebugger.prototype.debug = function (tx) {
console.log('loading trace...')
this.tx = tx
var self = this
debugger;
this.traceManager.resolveTrace(tx, function (error, result) {
console.log('trace loaded ' + result)
console.dir(arguments);
if (result) {
self.event.trigger('newTraceLoaded', [self.traceManager.trace])
if (self.breakpointManager && self.breakpointManager.hasBreakpoint()) {

@ -20,6 +20,8 @@ function TraceManager (options) {
// init section
TraceManager.prototype.resolveTrace = function (tx, callback) {
console.dir("resolveTrace: ");
console.dir(arguments);
this.tx = tx
this.init()
if (!this.web3) callback('web3 not loaded', false)
@ -68,6 +70,8 @@ TraceManager.prototype.isLoaded = function () {
}
TraceManager.prototype.getLength = function (callback) {
console.dir(this.trace)
console.trace('getLength')
if (!this.trace) {
callback('no trace available', null)
} else {

@ -5,6 +5,8 @@ function TraceRetriever (options) {
}
TraceRetriever.prototype.getTrace = function (txHash, callback) {
console.dir("getTrace: ");
console.dir(arguments);
var options = {
disableStorage: true,
disableMemory: false,

@ -198,6 +198,9 @@ web3VmProvider.prototype.getCode = function (address, cb) {
web3VmProvider.prototype.setProvider = function (provider) {}
web3VmProvider.prototype.traceTransaction = function (txHash, options, cb) {
console.dir("traceTransaction: ");
console.dir(arguments);
console.trace("here");
if (this.vmTraces[txHash]) {
if (cb) {
cb(null, this.vmTraces[txHash])

@ -55,6 +55,7 @@ function Compiler (handleImportCall) {
}
var compile = function (files, target) {
console.dir("compile");
self.event.trigger('compilationStarted', [])
internalCompile(files, target)
}
@ -210,6 +211,8 @@ 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
console.dir("compilationFinshed");
internalCompile(source.sources, source.target, missingInputs)
} else {
data = updateInterface(data)

Loading…
Cancel
Save