
Instead of repeatedly calling StepInstruction set breakpoints to the destination of CALL instructions (or on the CALL instructions themselves for indirect CALLs), then call Continue. Calls to unexported runtime functions are skipped. Reduces the number of code paths managing inferior state from 3 to 2 (StepInstruction, Continue). Fixes #561
23 lines
198 B
Go
23 lines
198 B
Go
package main
|
|
|
|
var n = 0
|
|
|
|
func CallFn2() {
|
|
n++
|
|
}
|
|
|
|
func CallFn(fn func()) {
|
|
fn()
|
|
}
|
|
|
|
func CallEface(eface interface{}) {
|
|
if eface != nil {
|
|
n++
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
CallFn(CallFn2)
|
|
CallEface(n)
|
|
}
|