aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-04-24 10:47:03 -0700
committerAustin Clements <austin@google.com>2017-04-28 22:43:20 +0000
commit390fdead0be0087d10e2e4faff7cb0a12b6a3ec8 (patch)
tree8cfa74198eeff2b5846f0c0fe90caeee583fd1dc /src/runtime
parentfb0fe4277d8393110569b66944dffb4b2c2c1687 (diff)
downloadgo-390fdead0be0087d10e2e4faff7cb0a12b6a3ec8.tar.xz
runtime: document runtime.Frames better
In particular, this says that Frames.Function uniquely identifies a function within a program. We depend on this in various places that use runtime.Frames in std, but it wasn't actually written down. Change-Id: Ie7ede348c17673e11ae513a094862b60c506abc5 Reviewed-on: https://go-review.googlesource.com/41610 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/symtab.go31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index 499832a730..8fb3d3ca94 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -23,23 +23,34 @@ type Frames struct {
// Frame is the information returned by Frames for each call frame.
type Frame struct {
- // Program counter for this frame; multiple frames may have
- // the same PC value.
+ // PC is the program counter for the location in this frame.
+ // For a frame that calls another frame, this will be the
+ // program counter of a call instruction. Because of inlining,
+ // multiple frames may have the same PC value, but different
+ // symbolic information.
PC uintptr
- // Func for this frame; may be nil for non-Go code or fully
- // inlined functions.
+ // Func is the Func value of this call frame. This may be nil
+ // for non-Go code or fully inlined functions.
Func *Func
- // Function name, file name, and line number for this call frame.
- // May be the empty string or zero if not known.
+ // Function is the package path-qualified function name of
+ // this call frame. If non-empty, this string uniquely
+ // identifies a single function in the program.
+ // This may be the empty string if not known.
// If Func is not nil then Function == Func.Name().
Function string
- File string
- Line int
- // Entry point for the function; may be zero if not known.
- // If Func is not nil then Entry == Func.Entry().
+ // File and Line are the file name and line number of the
+ // location in this frame. For non-leaf frames, this will be
+ // the location of a call. These may be the empty string and
+ // zero, respectively, if not known.
+ File string
+ Line int
+
+ // Entry point program counter for the function; may be zero
+ // if not known. If Func is not nil then Entry ==
+ // Func.Entry().
Entry uintptr
}