|
|
|
@ -140,24 +140,10 @@ TraceManager.prototype.getStackAt = function (stepIndex, callback) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TraceManager.prototype.getLastCallChangeSince = function (stepIndex, callback) {
|
|
|
|
|
// const check = this.checkRequestedStep(stepIndex)
|
|
|
|
|
// if (check) {
|
|
|
|
|
// return callback(check, null)
|
|
|
|
|
// }
|
|
|
|
|
// const callChange = util.findCall(stepIndex, this.traceCache.callsTree.call)
|
|
|
|
|
// if (callChange === null) {
|
|
|
|
|
// callback(null, 0)
|
|
|
|
|
// } else {
|
|
|
|
|
// callback(null, callChange)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
TraceManager.prototype.getLastCallChangeSince = function (stepIndex) { |
|
|
|
|
try { |
|
|
|
|
this.checkRequestedStep(stepIndex) |
|
|
|
|
} catch (check) { |
|
|
|
|
// return callback(check, null)
|
|
|
|
|
throw new Error(check) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -168,59 +154,16 @@ TraceManager.prototype.getLastCallChangeSince = function (stepIndex) { |
|
|
|
|
return callChange |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex, callback) {
|
|
|
|
|
// const check = this.checkRequestedStep(stepIndex)
|
|
|
|
|
// if (check) {
|
|
|
|
|
// return callback(check, null)
|
|
|
|
|
// }
|
|
|
|
|
// this.getLastCallChangeSince(stepIndex, function (error, resp) {
|
|
|
|
|
// if (error) {
|
|
|
|
|
// callback(error, null)
|
|
|
|
|
// } else {
|
|
|
|
|
// if (resp) {
|
|
|
|
|
// callback(null, resp.address)
|
|
|
|
|
// } else {
|
|
|
|
|
// callback('unable to get current called address. ' + stepIndex + ' does not match with a CALL')
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex) {
|
|
|
|
|
// const check = this.checkRequestedStep(stepIndex)
|
|
|
|
|
// if (check) {
|
|
|
|
|
// // return callback(check, null)
|
|
|
|
|
// throw new Error(check)
|
|
|
|
|
// }
|
|
|
|
|
// try {
|
|
|
|
|
// const resp = this.getLastCallChangeSince(stepIndex)
|
|
|
|
|
// if (!resp) {
|
|
|
|
|
// throw new Error('unable to get current called address. ' + stepIndex + ' does not match with a CALL')
|
|
|
|
|
// }
|
|
|
|
|
// return resp.address
|
|
|
|
|
// } catch (error) {
|
|
|
|
|
// throw new Error(error)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex, callback) { |
|
|
|
|
TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex) { |
|
|
|
|
try { |
|
|
|
|
this.checkRequestedStep(stepIndex) |
|
|
|
|
} catch (check) { |
|
|
|
|
return callback(check, null) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const resp = this.getLastCallChangeSince(stepIndex) |
|
|
|
|
if (!resp) { |
|
|
|
|
// throw new Error('unable to get current called address. ' + stepIndex + ' does not match with a CALL')
|
|
|
|
|
callback('unable to get current called address. ' + stepIndex + ' does not match with a CALL') |
|
|
|
|
throw new Error('unable to get current called address. ' + stepIndex + ' does not match with a CALL') |
|
|
|
|
} |
|
|
|
|
// return resp.address
|
|
|
|
|
return callback(null, resp.address) |
|
|
|
|
return resp.address |
|
|
|
|
} catch (error) { |
|
|
|
|
// throw new Error(error)
|
|
|
|
|
return callback(error) |
|
|
|
|
throw new Error(error) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|