File: issue573.go

package info (click to toggle)
delve 1.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,136 kB
  • sloc: ansic: 111,947; sh: 194; asm: 147; makefile: 43; python: 23
file content (28 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

// A debugger test.
//   dlv debug
//   b main.foo
//   c
//   s
//   s
// Expect to be stopped in fmt.Printf or runtime.duffzero
// In bug, s #2 runs to the process exit because the call
// to duffzero enters duffzero well after the nominal entry
// and skips the internal breakpoint placed by Step().
import "fmt"

var v int = 99

func foo(x, y int) (z int) { // c stops here
	fmt.Printf("x=%d, y=%d, z=%d\n", x, y, z) // s #1 stops here; s #2 is supposed to stop in Printf or duffzero.
	z = x + y
	return
}

func main() {
	x := v
	y := x * x
	z := foo(x, y)
	fmt.Printf("z=%d\n", z)
}