display errors

pull/7/head
Iuri Matias 6 years ago
parent 5d5fcae465
commit 9b557f0c7b
  1. 17
      remix-debug/rdb.js
  2. 2
      remix-debug/src/cmdline/index.js
  3. 6
      remix-debug/src/debugger/solidityState.js

@ -6,6 +6,7 @@ var fs = require('fs')
//var filename = 'test/sol/ballot.sol'
var filename = 'test/sol/simple_storage.sol'
var short_filename = "simple_storage.sol"
//var filename = 'browser/ballot.sol'
var input_json = {
@ -27,7 +28,7 @@ var input_json = {
}
}
input_json.sources[filename] = {content: fs.readFileSync(filename).toString()}
input_json.sources[short_filename] = {content: fs.readFileSync(filename).toString()}
console.dir(input_json)
@ -53,7 +54,7 @@ var deployContract = function (cb) {
let txNumber = null
let tx = null
let code = compilation.data.contracts[filename].SimpleStorage.evm.bytecode.object
let code = compilation.data.contracts[short_filename].SimpleStorage.evm.bytecode.object
console.dir("deploying...")
console.dir(code)
_web3.eth.sendTransaction({data: "0x" + code, from: _web3.eth.accounts[0], gas: 800000}, cb)
@ -65,14 +66,18 @@ let _web3 = cmd_line.debugger.debugger.web3
// var tx = "0x04aa74287b3c52e2ecab1cb066d22116317155503681870c516c95cdb148fa28"
// var tx = "0x04aa74287b3c52e2ecab1cb066d22116317155503681870c516c95cdb148fa28"
// var tx = "0x28bd66d99bc45b3f8d959126a26b8c97092892e63fc8ed90eb1598ebedf600ef"
// var tx = "0x3a7355c59f95db494872f33890dbabaceae1ca5330db86db49d24a5c29cd829a"
var tx = "0xf510c4f0b1d9ee262d7b9e9e87b4262f275fe029c2c733feef7dfa1e2b1e32aa"
// _web3.eth.getTransactionReceipt(tx, (err, data) => {
// console.dir(err)
// console.dir(data)
deployContract((err, tx) => {
cmd_line.startDebug(tx, filename)
})
// deployContract((err, tx) => {
cmd_line.startDebug(tx, short_filename)
cmd_line.events.on("source", () => {
cmd_line.getSource().forEach(console.dir)
})
// })
//})
const repl = require('repl')

@ -102,10 +102,12 @@ class CmdLine {
}
displayLocals () {
console.dir("= displayLocals")
console.dir(this.solidityLocals)
}
displayGlobals () {
console.dir("= displayGlobals")
console.dir(this.solidityState)
if (this.solidityState && this.solidityState.voters) {
console.dir(this.solidityState.voters)

@ -40,6 +40,8 @@ class DebuggerSolidityState {
try {
self.decode(index)
} catch(err) {
console.dir("====> error")
console.dir(err)
}
}, 500)
@ -51,7 +53,11 @@ class DebuggerSolidityState {
decode (index) {
const self = this
console.dir("currentStepIndex")
console.dir(self.stepManager.currentStepIndex)
self.traceManager.getCurrentCalledAddressAt(self.stepManager.currentStepIndex, function (error, address) {
console.dir(error)
console.dir(address)
if (error) {
return self.event.trigger('solidityState', [{}])
}

Loading…
Cancel
Save