delve/_fixtures/testnextprog.go
Derek Parker dc8c9cc2a4 Optimize Next implementation
Once the program detects that we have stepped into another function,
we simply calculate the return address and then set a breakpoint and
continue to that location, avoiding numerous syscalls.
2014-10-13 08:24:59 -05:00

44 lines
419 B
Go

package main
import (
"fmt"
"runtime"
"time"
)
func sleepytime() {
time.Sleep(time.Nanosecond)
}
func helloworld() {
fmt.Println("Hello, World!")
}
func testnext() {
var (
j = 1
f = 2
)
for i := 0; i <= 5; i++ {
j += j * (j ^ 3) / 100
if i == f {
fmt.Println("foo")
break
}
helloworld()
}
helloworld()
}
func main() {
runtime.LockOSThread()
for {
helloworld()
testnext()
}
}