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

Open
opened 2025-12-28 17:16:16 +00:00 by sami · 1 comment
Owner

Originally created by @AnnaShaleva on GitHub (Oct 16, 2024).

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:

  • range conditions
  • interop calls
  • contract calls
  • if statements
  • type assertions
  • and there are more.

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:
nspcc-dev/neo-go@86ed214e8a/pkg/compiler/debug.go (L128)

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

Originally created by @AnnaShaleva on GitHub (Oct 16, 2024). ## 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](https://github.com/user-attachments/assets/ce37489b-ce14-4666-b5bc-aca8e3a9108f) ![image](https://github.com/user-attachments/assets/bd20121f-97c4-41fa-9bef-dbdf92447353) ![image](https://github.com/user-attachments/assets/e37ba119-e2f6-45f8-a17e-432a57ccab8c) Known cases are: * `range` conditions * interop calls * contract calls * `if` statements * type assertions * and there are more. ## 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.
Author
Owner

@pri-3x commented on GitHub (Oct 22, 2024):

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

@pri-3x commented on GitHub (Oct 22, 2024): @AnnaShaleva PR for this : https://github.com/nspcc-dev/neo-go/pull/3639
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1388
No description provided.