|
|
@ -104,6 +104,17 @@ CodeManager.prototype.getInstructionIndex = function (address, step, callback) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CodeManager.prototype.newGetInstructionIndex = function (address, step) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const pc = this.traceManager.getCurrentPC(step) |
|
|
|
|
|
|
|
const itemIndex = this.codeResolver.getInstructionIndex(address, pc) |
|
|
|
|
|
|
|
return itemIndex |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
console.log(error) |
|
|
|
|
|
|
|
throw new Error('Cannot retrieve current PC for ' + step) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Retrieve the called function for the given @arg pc and @arg address |
|
|
|
* Retrieve the called function for the given @arg pc and @arg address |
|
|
|
* |
|
|
|
* |
|
|
@ -127,12 +138,13 @@ function retrieveCodeAndTrigger (codeMananger, address, stepIndex, tx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function retrieveIndexAndTrigger (codeMananger, address, step, code) { |
|
|
|
function retrieveIndexAndTrigger (codeMananger, address, step, code) { |
|
|
|
codeMananger.getInstructionIndex(address, step, (error, result) => { |
|
|
|
let result |
|
|
|
if (error) { |
|
|
|
try { |
|
|
|
return console.log(error) |
|
|
|
result = codeMananger.newGetInstructionIndex(address, step) |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
codeMananger.event.trigger('changed', [code, address, result]) |
|
|
|
return console.log(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
codeMananger.event.trigger('changed', [code, address, result]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module.exports = CodeManager |
|
|
|
module.exports = CodeManager |
|
|
|