pull/5370/head
yann300 3 years ago committed by joseph izang
parent dc598fe9bb
commit dc29857623
  1. 11
      libs/remix-debug/src/code/codeManager.ts
  2. 4
      libs/remix-debug/src/trace/traceAnalyser.ts
  3. 4
      libs/remix-ui/debugger-ui/src/reducers/assembly-items.ts

@ -148,8 +148,8 @@ export class CodeManager {
private async retrieveIndexAndTrigger (codeMananger, address, step, code) {
let result
let next
let returnInstructionIndexes = []
let outOfGasInstructionIndexes = []
const returnInstructionIndexes = []
const outOfGasInstructionIndexes = []
try {
result = codeMananger.getInstructionIndex(address, step)
@ -170,10 +170,9 @@ export class CodeManager {
outOfGasInstructionIndexes.push({ instructionIndex: this.getInstructionIndex(address, value.index), address })
}
}
} catch (error) {
return console.log(error)
}
} catch (error) {
return console.log(error)
}
try {
codeMananger.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes])
} catch (e) {

@ -52,14 +52,14 @@ export class TraceAnalyser {
if (traceHelper.isReturnInstruction(step) || traceHelper.isStopInstruction(step) || traceHelper.isRevertInstruction(step)) {
this.traceCache.pushStopIndex(index, this.traceCache.currentCall.call.address)
}
try {
if (parseInt(step.gas) - parseInt(step.gasCost) <= 0 || step.error === 'OutOfGas') {
this.traceCache.pushOutOfGasIndex(index, this.traceCache.currentCall.call.address)
}
} catch (e) {
console.error(e)
}
}
}
buildCalldata (index, step, tx, newContext) {

@ -32,8 +32,8 @@ const reducedOpcode = (opCodes, payload) => {
index: opCodes.index - bottom,
nextIndex: opCodes.nextIndex - bottom,
display: opCodes.code.slice(bottom, top),
returnInstructionIndexes: payload.returnInstructionIndexes.map((index) => index.instructionIndex - bottom ),
outOfGasInstructionIndexes: payload.outOfGasInstructionIndexes.map((index) => index.instructionIndex - bottom )
returnInstructionIndexes: payload.returnInstructionIndexes.map((index) => index.instructionIndex - bottom),
outOfGasInstructionIndexes: payload.outOfGasInstructionIndexes.map((index) => index.instructionIndex - bottom)
}
}

Loading…
Cancel
Save