ethdebug / format

Smart contract debugging data format – Standards development working group
https://ethdebug.github.io/format/
44 stars 4 forks source link

When a JUMPDEST is reached, the compiler should return precise information about the AST node it is jumped to (if any). #41

Open yann300 opened 9 months ago

gnidan commented 5 months ago

What I am currently thinking about what this might look like, I imagine there would be an object annotating the JUMPDEST operation that might resemble something like (for function calls specifically):

pc: 5
op: JUMPDEST
operation:
  begin: "function-call"
  name: "transfer"
  definition:
    file: 1
    start: 60
    length: 120
  from: 
    file: 1
    start: 80
    length: 33

Yann, you raise that loops also use JUMPDEST. There's an open question (IMO) about whether this debug format should include primitives about loops (probably?), but hopefully this provides a rough starting point to understand how this might work.

Of course we might also add AST node information, somewhere in that definition field :)