ethereumjs-monorepo icon indicating copy to clipboard operation
ethereumjs-monorepo copied to clipboard

VM: Support for better debugging and state manipulation

Open pinkiebell opened this issue 6 years ago • 3 comments

As a user, I need better support for debugging and state manipulation.

For vm.runCode, I need the ability to:

  • define initial stack values before the code runs
  • define initial memory before the code runs
  • define the program counter to start execution at a specific opcode

Also nice to have would be the ability to get information about memory reads or writes inside step events, this can be as simple as

memoryRead: {  'ptr': 2, 'len': 4 }
memoryWritten: { 'ptr': 5, 'len': 9 }

Another feature I thinking about is the ability to 'pause' and 'resume' an execution.

pinkiebell avatar Dec 14 '18 10:12 pinkiebell

Question is do wan't something like a debugging options-object for these calls or just expand the previous optional arguments?

pinkiebell avatar Dec 14 '18 10:12 pinkiebell

@holgerd77 @axic Would it make sense to extract runCode to an EVM library which doesn't have many dependencies, but uses an API like EEI to access data? This could potentially go a long way towards supporting other VMs, mocking them or for debugging purposes.

s1na avatar Dec 14 '18 10:12 s1na

On a first thought I would probably say: yes, circling in @cdetrio since this is pretty close related to a potential future eWASM kernel integration, also @vpulim.

holgerd77 avatar Dec 14 '18 10:12 holgerd77