CityOfZion / neo-boa

Python compiler for the Neo2 Virtual Machine, see neo3-boa for NEO3
MIT License
69 stars 55 forks source link

support for avmdbgnfo format #122

Closed devhawk closed 4 years ago

devhawk commented 4 years ago

The Neo Blockchain Toolkit includes a smart contract debugger. if neo-boa emitted debug information in the new avmdbgnfo format, this debugger would work for python smart contracts.

Note, neo-boa already supports a debug format. avmdbgnfo format could either be added as an alternative debug format or it can replace the existing format if it is found that there are no consumers of that format.

ixje commented 4 years ago

Note for others; this avmdbgnfo format is already supported in a separate branch by @devhawk

devhawk commented 4 years ago

there's a preliminary implementation of the avmdbgnfo format in the devhawk/avmdbgnfo branch of my neo-boa repo fork. It does need at least two things before it's production ready:

  1. avmdbgnfo includes information (i.e. name and type) about variables local to a given function. Variable type information is obviously blocked on #125, but emitting the variable name in the avmdbgnfo file (in the order the variables are stored in the altstack array) is important for the developer experience. I wasn't sure how to get the list of variables out of neo-boa, so I skipped that part. neo-debugger will generate a name for variables that aren't listed in the avmdbgnfo file, but then there is no way for the developer to map the variables listed in the debugger to the variables in their code.
  2. avmdbgnfo is a zip compressed file with a custom extension. My branch is currently emitting the json file w/o compression. Frankly, the debugger is smart enough to handle uncompressed files, but I think it would be better for neo-boa to compress the json file as NEON does.
ixje commented 4 years ago

@devhawk is this resolved with v0.7.0?

devhawk commented 4 years ago

Yes we can close this