
This patch adds support for listing and setting breakpoints on inlined functions within stripped binaries. It uses a forked version of `debug/gosym` copied from golang.org/x/vuln/internal/vulncheck/internal/gosym which adds support for parsing the inline tree of the pclntab section. Parsing this section requires knowing the offset of the "go:func.*" symbol, which is not present in stripped binaries via the ``.symtab` section so instead, we search the `.noptrdata` section which contains `runtime.moduledatap` which contains the value of that missing symbol, which we then can use to find the inline tree for a given function. Given all this we parse the inline tree for each function we find, and then add that information the the appropriate `Function` contained in `bi.Functions`, using a relatively empty `Function` struct as what would be the abstract origin.
16 lines
166 B
Go
16 lines
166 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func callme(i int) int {
|
|
return i * i
|
|
}
|
|
|
|
func main() {
|
|
j := 0
|
|
j += callme(2)
|
|
fmt.Println(j)
|
|
fmt.Println(j + 1)
|
|
fmt.Println(j + 2)
|
|
}
|