delve/_fixtures/stepshadow.go
Alessandro Arzilli 36980dcbf9
proc: step breakpoints shouldn't hide normal breakpoints (#3287)
When using Step on a function that has a dynamic CALL instruction we
set a Step breakpoint on the call.
When it is hit we determine the destination of the CALL by looking at
registers, set a breakpoint there and continue.
If the Step breakpoint is hit simultaneously with a normal breakpoint
our Step logic will take precedence and the normal breakpoint hit will
be hidden from the user.

Move the Step logic to a breaklet callback so that it does not
interfere with the decision to stop.
2023-04-24 12:12:54 -07:00

32 lines
367 B
Go

package main
import (
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
wg.Add(1)
go goroutineA(&wg)
f := stacktraceme1
for i := 0; i < 100; i++ {
fmt.Printf("main %d\n", i)
f()
}
wg.Wait()
}
func goroutineA(wg *sync.WaitGroup) {
defer wg.Done()
for i := 0; i < 100; i++ {
stacktraceme2()
}
}
func stacktraceme1() {
}
func stacktraceme2() {
}