delve/_fixtures/locationsprog2.go
aarzilli 70cbbdc083 service/locations: hooked expression evaluator to location specifiers
Location specifiers starting with '*' can be followed by any
expression supported by the evaluator.
The expression should evaluate to either an integer (which will be
interpreted as an address) or to a function pointer (which will be
dereferenced to get the function's entry point).
2016-01-17 21:45:28 -08:00

30 lines
379 B
Go

package main
import (
"fmt"
"runtime"
)
func afunction(s string) {
fmt.Println(s)
}
type someStruct struct {
s string
}
func (o *someStruct) structfunc(s2 string) {
fmt.Println(o.s, s2)
}
func main() {
fn1 := afunction
var o someStruct
fn2 := o.structfunc
fn3 := func(s string) {
fmt.Println("inline", s)
}
runtime.Breakpoint()
fmt.Println(fn1, fn2, fn3, o)
}