AddBreakPoint to apply to all context with the same prog #1422

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

Originally created by @ixje on GitHub (Nov 12, 2024).

I'm always frustrated when breakpoints set for a given prog (=smart contract) don't hit because they are registered for the current context and not globally for the smart contract.

Describe the solution you'd like

I'd like an AddBreakPoint on VM which allows to set a global breakpoint for a given contract (similar to the C# one).

Describe alternatives you've considered

Create AddBreakpoint / RemoveBreakPoint on Context.

Additional context

Imagine an IDE with NEO smart contract debugger support build on neo-go. The IDE tells what addresses to put a break point on, then runs the debugger waiting for a break point to hit. Currently it won't hit any break points except for those in the entry function.

Originally created by @ixje on GitHub (Nov 12, 2024). ## Is your feature request related to a problem? Please describe. I'm always frustrated when breakpoints set for a given `prog` (=smart contract) don't hit because they are registered for the current context and not globally for the smart contract. ## Describe the solution you'd like I'd like an `AddBreakPoint` on `VM` which allows to set a global breakpoint for a given contract (similar to the [C# one](https://github.com/neo-project/neo-vm/blob/524545f944eacaf2ebbfdcf98152a6a933b09f24/src/Neo.VM/Debugger.cs#L37)). ## Describe alternatives you've considered Create `AddBreakpoint` / `RemoveBreakPoint` on `Context`. ## Additional context Imagine an IDE with NEO smart contract debugger support build on neo-go. The IDE tells what addresses to put a break point on, then runs the debugger waiting for a break point to hit. Currently it won't hit any break points except for those in the entry function.
Author
Owner

@ixje commented on GitHub (Nov 12, 2024):

If you're fine with the following rough approach I'm happy to PR for it

func AddBreakPoint(h uint160, addr int) {
   for ctx in vm.istack {
      if h == ctx.scriptHash {
          ctx.breakpoints.add(addr)
      }
}

and similar logic for a RemoveBreakPoint

@ixje commented on GitHub (Nov 12, 2024): If you're fine with the following rough approach I'm happy to PR for it ``` func AddBreakPoint(h uint160, addr int) { for ctx in vm.istack { if h == ctx.scriptHash { ctx.breakpoints.add(addr) } } ``` and similar logic for a `RemoveBreakPoint`
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#1422
No description provided.