Commit d077a047 authored by aniket-engg's avatar aniket-engg Committed by Aniket

debugger ans solidityLocals updated

parent f57be84d
......@@ -7,7 +7,17 @@ const BreakpointManager = require('../code/breakpointManager')
const StepManager = require('./stepManager')
const VmDebuggerLogic = require('./VmDebugger')
function Debugger (options) {
export class Debugger {
event
offsetToLineColumnConverter
compilationResult
debugger
breakPointManager
step_manager
vmDebuggerLogic
constructor (options) {
this.event = new EventManager()
this.offsetToLineColumnConverter = options.offsetToLineColumnConverter
......@@ -47,9 +57,9 @@ function Debugger (options) {
this.debugger.event.register('traceUnloaded', this, () => {
this.event.trigger('debuggerStatus', [false])
})
}
}
Debugger.prototype.registerAndHighlightCodeItem = async function (index) {
async registerAndHighlightCodeItem (index) {
// register selected code item, highlight the corresponding source location
// this.debugger.traceManager.getCurrentCalledAddressAt(index, async (error, address) => {
......@@ -81,13 +91,13 @@ Debugger.prototype.registerAndHighlightCodeItem = async function (index) {
} catch (error) {
return console.log(error)
}
}
}
Debugger.prototype.updateWeb3 = function (web3) {
updateWeb3 (web3) {
this.debugger.web3 = web3
}
}
Debugger.prototype.debug = function (blockNumber, txNumber, tx, loadingCb) {
debug (blockNumber, txNumber, tx, loadingCb) {
const web3 = this.debugger.web3
return new Promise((resolve, reject) => {
......@@ -122,9 +132,9 @@ Debugger.prototype.debug = function (blockNumber, txNumber, tx, loadingCb) {
return reject(e.message)
}
})
}
}
Debugger.prototype.debugTx = function (tx, loadingCb) {
debugTx (tx, loadingCb) {
this.step_manager = new StepManager(this.debugger, this.debugger.traceManager)
this.debugger.codeManager.event.register('changed', this, (code, address, instIndex) => {
......@@ -150,11 +160,10 @@ Debugger.prototype.debugTx = function (tx, loadingCb) {
loadingCb()
this.debugger.debug(tx)
}
}
Debugger.prototype.unload = function () {
unload () {
this.debugger.unLoad()
this.event.trigger('debuggerUnloaded')
}
}
module.exports = Debugger
const EventManager = require('../eventManager')
const localDecoder = require('../solidity-decoder/localDecoder')
const StorageViewer = require('../storage/storageViewer')
class DebuggerSolidityLocals {
export class DebuggerSolidityLocals {
event
stepManager
internalTreeCall
storageResolver
traceManager
tx
_sourceLocation
constructor (tx, _stepManager, _traceManager, _internalTreeCall) {
this.event = new EventManager()
this.stepManager = _stepManager
......@@ -28,7 +36,7 @@ class DebuggerSolidityLocals {
}, 500)
}
decode (sourceLocation, cursor) {
decode (sourceLocation, cursor?) {
const self = this
this.event.trigger('solidityLocalsMessage', [''])
this.traceManager.waterfall([
......@@ -94,5 +102,3 @@ class DebuggerSolidityLocals {
}, 500)
}
}
module.exports = DebuggerSolidityLocals
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment