unload trace

pull/7/head
yann300 8 years ago
parent a690b96448
commit 837a695b55
  1. 3
      src/CalldataPanel.js
  2. 3
      src/CallstackPanel.js
  3. 4
      src/Ethdebugger.js
  4. 3
      src/MemoryPanel.js
  5. 1
      src/Slider.js
  6. 3
      src/StackPanel.js
  7. 12
      src/Sticker.js
  8. 3
      src/StoragePanel.js
  9. 1
      src/TxBrowser.js

@ -23,11 +23,12 @@ CalldataPanel.prototype.init = function () {
self.traceManager.getCallDataAt(index, function (error, calldata) { self.traceManager.getCallDataAt(index, function (error, calldata) {
if (error) { if (error) {
self.basicPanel.data = ''
console.log(error) console.log(error)
} else if (self.parent.currentStepIndex === index) { } else if (self.parent.currentStepIndex === index) {
self.basicPanel.data = self.format(calldata) self.basicPanel.data = self.format(calldata)
self.basicPanel.update()
} }
self.basicPanel.update()
}) })
}) })
} }

@ -24,10 +24,11 @@ CallstackPanel.prototype.init = function () {
self.traceManager.getCallStackAt(index, function (error, callstack) { self.traceManager.getCallStackAt(index, function (error, callstack) {
if (error) { if (error) {
console.log(error) console.log(error)
self.basicPanel.data = ''
} else if (self.parent.currentStepIndex === index) { } else if (self.parent.currentStepIndex === index) {
self.basicPanel.data = self.format(callstack) self.basicPanel.data = self.format(callstack)
self.basicPanel.update()
} }
self.basicPanel.update()
}) })
}) })
} }

@ -24,6 +24,9 @@ function Ethdebugger (_context) {
this.txBrowser.register('newTxRequested', this, function (blockNumber, txIndex, tx) { this.txBrowser.register('newTxRequested', this, function (blockNumber, txIndex, tx) {
self.startDebugging(blockNumber, txIndex, tx) self.startDebugging(blockNumber, txIndex, tx)
}) })
this.txBrowser.register('unloadRequested', this, function (blockNumber, txIndex, tx) {
self.unLoad()
})
this.stepManager = new StepManager(this, this.traceManager) this.stepManager = new StepManager(this, this.traceManager)
this.stepManager.register('stepChanged', this, function (stepIndex) { this.stepManager.register('stepChanged', this, function (stepIndex) {
self.stepChanged(stepIndex) self.stepChanged(stepIndex)
@ -36,7 +39,6 @@ Ethdebugger.prototype.render = function () {
return ( return (
yo`<div style=${ui.formatCss(style.font)}> yo`<div style=${ui.formatCss(style.font)}>
<h1 style=${ui.formatCss(style.container)}>Eth Debugger</h1> <h1 style=${ui.formatCss(style.container)}>Eth Debugger</h1>
<div onclick=${function () { self.unLoad() }}>X</div>
${this.txBrowser.render()} ${this.txBrowser.render()}
${this.stepManager.render()} ${this.stepManager.render()}
${this.vmDebugger.render()} ${this.vmDebugger.render()}

@ -25,10 +25,11 @@ MemoryPanel.prototype.init = function () {
self.traceManager.getMemoryAt(index, function (error, memory) { self.traceManager.getMemoryAt(index, function (error, memory) {
if (error) { if (error) {
console.log(error) console.log(error)
self.basicPanel.data = ''
} else if (self.parent.currentStepIndex === index) { } else if (self.parent.currentStepIndex === index) {
self.basicPanel.data = util.formatMemory(memory, 16) self.basicPanel.data = util.formatMemory(memory, 16)
self.basicPanel.update()
} }
self.basicPanel.update()
}) })
}) })
} }

@ -23,6 +23,7 @@ Slider.prototype.render = function () {
type='range' type='range'
min=0 min=0
max=${this.max} max=${this.max}
value=0
onmouseup=${function () { self.onMouseUp() }} onmouseup=${function () { self.onMouseUp() }}
disabled=${this.disabled} /> disabled=${this.disabled} />
</div>` </div>`

@ -23,11 +23,12 @@ StackPanel.prototype.init = function () {
self.traceManager.getStackAt(index, function (error, stack) { self.traceManager.getStackAt(index, function (error, stack) {
if (error) { if (error) {
self.basicPanel.data = ''
console.log(error) console.log(error)
} else if (self.parent.currentStepIndex === index) { } else if (self.parent.currentStepIndex === index) {
self.basicPanel.data = self.format(stack) self.basicPanel.data = self.format(stack)
self.basicPanel.update()
} }
self.basicPanel.update()
}) })
}) })
} }

@ -78,37 +78,41 @@ Sticker.prototype.init = function () {
self.traceManager.getCurrentStep(index, function (error, step) { self.traceManager.getCurrentStep(index, function (error, step) {
if (error) { if (error) {
console.log(error) console.log(error)
self.step = ''
} else { } else {
self.step = step self.step = step
yo.update(self.view, self.render())
} }
yo.update(self.view, self.render())
}) })
self.traceManager.getMemExpand(index, function (error, addmem) { self.traceManager.getMemExpand(index, function (error, addmem) {
if (error) { if (error) {
console.log(error) console.log(error)
self.addmemory = ''
} else { } else {
self.addmemory = addmem self.addmemory = addmem
yo.update(self.view, self.render())
} }
yo.update(self.view, self.render())
}) })
self.traceManager.getStepCost(index, function (error, gas) { self.traceManager.getStepCost(index, function (error, gas) {
if (error) { if (error) {
console.log(error) console.log(error)
self.gas = gas
} else { } else {
self.gas = gas self.gas = gas
yo.update(self.view, self.render())
} }
yo.update(self.view, self.render())
}) })
self.traceManager.getRemainingGas(index, function (error, remaingas) { self.traceManager.getRemainingGas(index, function (error, remaingas) {
if (error) { if (error) {
console.log(error) console.log(error)
self.remainingGas = ''
} else { } else {
self.remainingGas = remaingas self.remainingGas = remaingas
yo.update(self.view, self.render())
} }
yo.update(self.view, self.render())
}) })
}) })
} }

@ -24,10 +24,11 @@ StoragePanel.prototype.init = function () {
self.traceManager.getStorageAt(index, self.parent.tx, function (error, storage) { self.traceManager.getStorageAt(index, self.parent.tx, function (error, storage) {
if (error) { if (error) {
console.log(error) console.log(error)
self.basicPanel.data = self.formatStorage(storage)
} else if (self.parent.currentStepIndex === index) { } else if (self.parent.currentStepIndex === index) {
self.basicPanel.data = self.formatStorage(storage) self.basicPanel.data = self.formatStorage(storage)
self.basicPanel.update()
} }
self.basicPanel.update()
}) })
}) })
} }

@ -78,6 +78,7 @@ TxBrowser.prototype.render = function () {
<button onclick=${function () { self.submit() }}> <button onclick=${function () { self.submit() }}>
Get Get
</button> </button>
<button onclick=${function () { self.trigger('unloadRequested') }}>Unload</button>
<div style=${ui.formatCss(style.transactionInfo)}> <div style=${ui.formatCss(style.transactionInfo)}>
<table> <table>
<tbody> <tbody>

Loading…
Cancel
Save