From d58125ecd22649eb0a4b33715f39d6696b13c5fb Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 6 Jul 2017 12:36:25 -0400 Subject: [PATCH] runtime: document FuncForPC behavior with inlining Change-Id: I1c02aa4f7131ae984fda66b32e8a993c0a40b8f4 Reviewed-on: https://go-review.googlesource.com/47690 Reviewed-by: Brad Fitzpatrick Reviewed-by: Russ Cox --- src/runtime/symtab.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 40add013e4..ced42dad61 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -573,6 +573,9 @@ func moduledataverify1(datap *moduledata) { // FuncForPC returns a *Func describing the function that contains the // given program counter address, or else nil. +// +// If pc represents multiple functions because of inlining, it returns +// the *Func describing the outermost frame at pc. func FuncForPC(pc uintptr) *Func { return findfunc(pc)._Func() } -- 2.50.0