nspcc-dev / neo-go

Go Node and SDK for the Neo blockchain
MIT License
124 stars 79 forks source link

Some of statements are missing sequence points in the debug info #3618

Open AnnaShaleva opened 1 month ago

AnnaShaleva commented 1 month ago

Current Behavior

Debug info sequence points are not generated for some kind of statements. For example, calls to interops, builtins and syscalls don't have their own sequence points. Neotest coverage uses sequents points for coverage calculation, and missing points lead to untracked blocks of code in the contract: image image image Known cases are:

Expected Behavior

Cover with sequence points as much as possible.

Possible Solution

We have a method that saves sequence points of the provided AST node to the debug info: https://github.com/nspcc-dev/neo-go/blob/86ed214e8a53859fd85482370be20eb613c61419/pkg/compiler/debug.go#L128

This method should be called everywhere where sequence point is required.

pri-3x commented 1 month ago

@AnnaShaleva PR for this : https://github.com/nspcc-dev/neo-go/pull/3639