Building the first Solidity debugger

Hey folks,

we’re building a woke, a development framework, static analyzer and property-based fuzzer for Solidity.

We’re considering building a Solidity debugger that would show values of local variables. Do you think this would be possible? Do you know if invariants such as the following

  1. The order on the stack of arguments in an (internal) function call is the same as the Solidity parameters.
  2. In a (local) variable assignment, the value of the variable is the top element on the stack (at the end of the opcode sequence that has the same src mapping as the Assingnment Ast node).
  3. The src mapping of any opcode exactly corresponds to a src mapping of some Ast node.
  4. Src mappings of ast nodes form a tree – the src mapping of a node is a subset of the src mapping of its parent.
  5. (We would also like to make mappings fully iterable, so:) Assginment to mappings follow a predictable pattern (so it will be possible to use this pattern to figure out the key of the mapping assignment…)

are true for all supported versions (solc 0.5+) and all cominations of compiler options?

The lead developer Michal Prevratil might also have some things to say

i should ok for solc 0.5+ . but i want to handle solc blew 0.5, how do that?