git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 8ad1e8d0074a39fe6116a5343888dbb3e75c06d2

updated debuging interface

wanderer committed on 11/7/2016, 12:28:18 PM
Parent: 7465ee54b512e6772d88465794c551333e42ecfe

Files changed

debugInterface.jschanged
debugInterface.jsView
@@ -5,17 +5,17 @@
55 * This expose some functions that can help with debugging wast
66 */
77
88 module.exports = class DebugInterface {
9- constructor (environment) {
10- this.environment = environment
9+ constructor (kernel) {
10+ this.kernel = kernel
1111 }
1212
13- setModule (mod) {
14- this.module = mod
13+ static get name () {
14+ return 'debug'
1515 }
1616
17- get exportTable () {
17+ get exports () {
1818 return {
1919 'print': function (a) {
2020 console.log(a)
2121 },
@@ -31,9 +31,9 @@
3131 const opcode = opcodes(op)
3232 if (opcode.number) {
3333 opcode.name += opcode.number
3434 }
35- console.error(`op: ${opcode.name} gas: ${this.environment.gasLeft}`)
35+ console.error(`op: ${opcode.name} gas: ${this.kernel.environment.gasLeft}`)
3636 console.log('-------------stack--------------')
3737 for (let i = sp; i >= 0; i -= 32) {
3838 console.log(`${(sp - i) / 32} ${this.getMemoryBuffer(i).reverse().toString('hex')}`)
3939 }
@@ -41,7 +41,7 @@
4141 }
4242 }
4343
4444 getMemoryBuffer (offset) {
45- return new Buffer(this.module.exports.memory.slice(offset, offset + 32))
45+ return new Buffer(this.kernel.memory.slice(offset, offset + 32))
4646 }
4747 }

Built with git-ssb-web