fix don't call `getValidSourceLocationFromVMTraceIndex` 2 times

pull/5370/head
yann300 3 years ago
parent a84633e40d
commit e380ad7fae
  1. 11
      libs/remix-debug/src/debugger/debugger.ts

@ -89,15 +89,19 @@ export class Debugger {
}
const lineColumnPos = await this.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, sources, astSources)
this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address])
this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [rawLocation])
} else {
this.event.trigger('newSourceLocation', [null])
this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [null])
}
}).catch((_error) => {
this.event.trigger('newSourceLocation', [null])
this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [null])
})
// })
} catch (error) {
this.event.trigger('newSourceLocation', [null])
this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [null])
return console.log(error)
}
}
@ -133,13 +137,6 @@ export class Debugger {
async debugTx (tx, loadingCb) {
this.step_manager = new DebuggerStepManager(this.debugger, this.debugger.traceManager)
this.debugger.codeManager.event.register('changed', this, (code, address, instIndex) => {
if (!this.debugger.solidityProxy.contracts) return
this.debugger.callTree.sourceLocationTracker.getValidSourceLocationFromVMTraceIndex(address, this.step_manager.currentStepIndex, this.debugger.solidityProxy.contracts).then((sourceLocation) => {
this.vmDebuggerLogic.event.trigger('sourceLocationChanged', [sourceLocation])
})
})
this.vmDebuggerLogic = new VmDebuggerLogic(this.debugger, tx, this.step_manager, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree)
this.vmDebuggerLogic.start()

Loading…
Cancel
Save