diff options
| author | Russ Cox <rsc@golang.org> | 2014-09-03 13:02:48 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-09-03 13:02:48 -0400 |
| commit | 97f8386af7907191cefbbfa26a3bd01c4ec95655 (patch) | |
| tree | 7c0fb064931669a113be5d07492c4b510dae7169 /src/pkg/runtime/extern.go | |
| parent | 4930a8d0582d96d390339d2ca454ff8375bb535a (diff) | |
| download | go-97f8386af7907191cefbbfa26a3bd01c4ec95655.tar.xz | |
runtime: convert symtab.c into symtab.go
Because symtab.c was partially converted before,
the diffs are not terribly useful.
The earlier conversion was trying to refactor or
clean up the code in addition to doing the translation.
It also made a mistake by redefining Func to be something
users could overwrite.
I undid those changes, making symtab.go a more
literal line-for-line translation of symtab.c instead.
LGTM=josharian
R=golang-codereviews, dave, bradfitz, josharian
CC=golang-codereviews, iant, khr, r
https://golang.org/cl/140880043
Diffstat (limited to 'src/pkg/runtime/extern.go')
| -rw-r--r-- | src/pkg/runtime/extern.go | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go index 2ca22d923b..3d06a23fce 100644 --- a/src/pkg/runtime/extern.go +++ b/src/pkg/runtime/extern.go @@ -75,12 +75,6 @@ of the run-time system. */ package runtime -import "unsafe" - -// sigpanic is the C function sigpanic. -// That is, unsafe.Pointer(&sigpanic) is the C function pointer for sigpanic. -var sigpanic struct{} - // Caller reports file and line number information about function invocations on // the calling goroutine's stack. The argument skip is the number of stack frames // to ascend, with 0 identifying the caller of Caller. (For historical reasons the @@ -109,7 +103,7 @@ func Caller(skip int) (pc uintptr, file string, line int, ok bool) { // All architectures turn faults into apparent calls to sigpanic. // If we see a call to sigpanic, we do not back up the PC to find // the line number of the call instruction, because there is no call. - if xpc > f.entry && (g == nil || g.entry != uintptr(unsafe.Pointer(&sigpanic))) { + if xpc > f.entry && (g == nil || g.entry != funcPC(sigpanic)) { xpc-- } line = int(funcline(f, xpc, &file)) @@ -117,11 +111,6 @@ func Caller(skip int) (pc uintptr, file string, line int, ok bool) { return } -func findfunc(uintptr) *_func - -//go:noescape -func funcline(*_func, uintptr, *string) int32 - // Callers fills the slice pc with the program counters of function invocations // on the calling goroutine's stack. The argument skip is the number of stack frames // to skip before recording in pc, with 0 identifying the frame for Callers itself and |
