File: stackwatchbug.go

package info (click to toggle)
delve 1.24.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,092 kB
  • sloc: ansic: 111,943; sh: 169; asm: 141; makefile: 43; python: 23
file content (20 lines) | stat: -rw-r--r-- 378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main

import (
	"fmt"
)

func multiRound() {
	vars := []int{0, 1, 2, 3, 4, 5}
	for i := range vars { // line 9: set watchpoints
		if i > 0 {
			vars[i] = vars[i-1]
			fmt.Println() // line 12: watchpoints hit
		}
	}
}

func main() {
	multiRound() // line 18: after restart, last watchpoint out of scope
	return       // line 19: all watchpoints should go out of scope
}