aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-caller.c
AgeCommit message (Collapse)AuthorFilesLines
2020-12-30libgo: update to Go1.16beta1 releaseIan Lance Taylor1-4/+3
This does not yet include support for the //go:embed directive added in this release. * Makefile.am (check-runtime): Don't create check-runtime-dir. (mostlyclean-local): Don't remove check-runtime-dir. (check-go-tool, check-vet): Copy in go.mod and modules.txt. (check-cgo-test, check-carchive-test): Add go.mod file. * Makefile.in: Regenerate. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/280172
2020-01-21libgo: update to Go1.14beta1Ian Lance Taylor1-8/+33
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214297
2019-05-14libgo: reduce overhead for memory/block/mutex profilingIan Lance Taylor1-6/+12
Revise the gccgo version of memory/block/mutex profiling to reduce runtime overhead. The main change is to collect raw stack traces while the profile is on line, then post-process the stacks just prior to the point where we are ready to use the final product. Memory profiling (at a very low sampling rate) is enabled by default, and the overhead of the symbolization / DWARF-reading from backtrace_full was slowing things down relative to the main Go runtime. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/171497 From-SVN: r271172
2019-02-15compiler, runtime: harmonize types referenced by both C and GoIan Lance Taylor1-2/+2
Compiling with LTO revealed a number of cases in the runtime and standard library where C and Go disagreed about the type of an object or function (or where Go and code generated by the compiler disagreed). In all cases the underlying representation was the same (e.g., uintptr vs. void*), so this wasn't causing actual problems, but it did result in a number of annoying warnings when compiling with LTO. Reviewed-on: https://go-review.googlesource.com/c/160700 From-SVN: r268923
2019-01-05runtime: prevent deadlock when profiling signal arrives during tracebackIan Lance Taylor1-1/+8
Traceback routines, e.g. callers and funcentry, may call __go_get_backtrace_state. If a profiling signal arrives while we are in the critical section of __go_get_backtrace_state, it tries to do a traceback, which also calls __go_get_backtrace_state, which tries to enter the same critical section and will deadlock. Prevent this deadlock by setting up runtime_in_callers before calling __go_get_backtrace_state. Found while investigating golang/go#29448. Will add a test in the next CL. Updates golang/go#29448. Reviewed-on: https://go-review.googlesource.com/c/156037 From-SVN: r267590
2018-09-24libgo: update to Go 1.11Ian Lance Taylor1-11/+0
Reviewed-on: https://go-review.googlesource.com/136435 gotools/: * Makefile.am (mostlyclean-local): Run chmod on check-go-dir to make sure it is writable. (check-go-tools): Likewise. (check-vet): Copy internal/objabi to check-vet-dir. * Makefile.in: Rebuild. From-SVN: r264546
2018-06-28runtime: don't stat a NULL filenameIan Lance Taylor1-1/+1
Noticed in https://gcc.gnu.org/PR86331. Reviewed-on: https://go-review.googlesource.com/121417 From-SVN: r262234
2018-02-22runtime: funcfileline: get missing function name from symbol tableIan Lance Taylor1-3/+11
Copy the idea of https://golang.org/cl/92756 to funcfileline, which is used by runtime.FuncForPC, runtime.(*Frames).Next, and others. Reviewed-on: https://go-review.googlesource.com/96175 From-SVN: r257913
2017-10-11runtime: fix issues on AIX about uintptr(_t)Ian Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/69891 From-SVN: r253664
2017-07-21runtime: don't use runtime_lock in __go_get_backtrace_stateIan Lance Taylor1-3/+11
If getSiginfo does not know how to determine the PC, it will call runtime_callers. That can happen in a thread that was started by non-Go code, in which case the TLS variable g will not be set, in which case runtime_lock will crash. Avoid the problem by using atomic operations for the lock. This is OK since creating a backtrace state is fast and never blocks. The test case is TestCgoExternalThreadSIGPROF in the runtime package on a system that getSiginfo doesn't handle specially. Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50650 From-SVN: r250439
2016-10-14runtime: just do file/line lookup in C, move Func to GoIan Lance Taylor1-96/+19
In order to port stack backtraces to Go, we need the ability to look up file/line information for PC values without allocating memory. This patch moves the handling of Func from C code to Go code, and simplifies the C code to just look up function/file/line/entry information for a PC. Reviewed-on: https://go-review.googlesource.com/31150 From-SVN: r241172
2016-09-29runtime: copy runtime.go and runtime1.go from Go 1.7Ian Lance Taylor1-2/+10
Also copy over cputicks.go, env_posix.go, vdso_none.go, stubs2.go, and a part of os_linux.go. Remove the corresponding functions from the C code in libgo/go/runtime. Add some transitional support functions to stubs.go. This converts several minor functions from C to Go. Reviewed-on: https://go-review.googlesource.com/29962 From-SVN: r240609
2016-07-22libgo: update to go1.7rc3Ian Lance Taylor1-4/+56
Reviewed-on: https://go-review.googlesource.com/25150 From-SVN: r238662
2015-05-05re PR go/66016 (Accessing nil Func's name results in crash)Ian Lance Taylor1-0/+2
PR go/66016 runtime: Don't crash in Func.Name if the Func is nil. Related to Go issue 10696 From-SVN: r222816
2015-04-17re PR go/65798 (runtime.Caller returns ok=true when return data is invalid)Ian Lance Taylor1-1/+1
PR go/65798 runtime: In Caller don't return ok == true if PC == 0. GCC PR 65798 reports that this can happen in some cases. From-SVN: r222204
2015-03-09re PR go/65349 (go tool crashes, can't compile go code on 32bit linux systems)Ian Lance Taylor1-30/+6
PR go/65349 runtime: Don't call malloc from __go_file_line callback. When crashing, we call runtime_printcreatedby which calls __go_file_line which used to call the Go malloc. If we are crashing due to a signal due to heap corruption of some sort, the GO malloc lock might already be held, leading to a crash within a crash. Avoid that by assuming that the libbacktrace strings will stick around, as we already do in go-callers.c. From-SVN: r221291
2014-08-02re PR other/61895 (libbacktrace crashes with bus error with empty file argv[0])Ian Lance Taylor1-0/+12
PR other/61895 runtime: Ignore small argv[0] file for backtrace. Reportedly in some cases Docker starts processes with argv[0] pointing to an empty file. That would cause libgo to pass that empty file to libbacktrace, which would then fail to do any backtraces. Everything should work fine if libbacktrace falls back to /proc/self/exe. This patch to libgo works around the problem by ignoring argv[0] if it is a small file, or if stat fails. This is not a perfect fix but it's an unusual problem. From-SVN: r213513
2014-07-19reflect, runtime: Use libffi closures to implement reflect.MakeFunc.Ian Lance Taylor1-1/+1
Keep using the existing 386 and amd64 code on those archs, since it is more efficient. From-SVN: r212853
2013-11-19runtime: Update for change to libbacktrace library.Ian Lance Taylor1-1/+1
From-SVN: r205031
2013-11-14runtime: Don't use filename without '/' for backtrace library.Ian Lance Taylor1-0/+7
Fixes http://golang.org/issue/6715. From-SVN: r204828
2013-11-06libgo: Update to October 24 version of master library.Ian Lance Taylor1-0/+20
From-SVN: r204466
2013-01-30runtime: In backtraces, get inline functions, skip split-stack fns.Ian Lance Taylor1-5/+5
From-SVN: r195591
2013-01-24re PR go/46986 (Go is not supported on Darwin)Ian Lance Taylor1-3/+3
PR go/46986 all: prepend #__USER_LABEL_PREFIX__ to mangled Go symbols For old-fashioned Darwin. From-SVN: r195438
2012-11-01compiler, runtime: More steps toward separating int and intgo.Ian Lance Taylor1-30/+28
From-SVN: r193059
2012-10-08runtime: Fix __go_symbol_value val argument to backtrace_syminfo.Ian Lance Taylor1-1/+1
From-SVN: r192194
2012-10-05runtime: Use argv[0] to get executable name for backtrace.Ian Lance Taylor1-1/+6
From-SVN: r192123
2012-09-28runtime: runtime.Caller should succeed even without debug info.Ian Lance Taylor1-1/+2
From-SVN: r191833
2012-09-28libgo: Use libbacktrace rather than debug/elf registration.Ian Lance Taylor1-35/+115
From-SVN: r191831
2012-05-24runtime: Correct definition of __go_file_line to match declaration.Ian Lance Taylor1-1/+1
From Rainer Orth. From-SVN: r187851
2012-05-14libgo: Use -fgo-pkgpath.Ian Lance Taylor1-4/+4
From-SVN: r187485
2012-03-07libgo: Implement and use runtime.Caller, runtime.Func.FileLine.Ian Lance Taylor1-15/+110
From-SVN: r185025
2011-01-05re PR go/46958 (ARM Go Does Not Compile (__builtin_return_address))Ian Lance Taylor1-1/+1
PR go/46958 PR go/46965 Call __builtin_return_address with 0 rather than 1. From-SVN: r168495
2010-12-03Add Go frontend, libgo library, and Go testsuite.Ian Lance Taylor1-0/+51
gcc/: * gcc.c (default_compilers): Add entry for ".go". * common.opt: Add -static-libgo as a driver option. * doc/install.texi (Configuration): Mention libgo as an option for --enable-shared. Mention go as an option for --enable-languages. * doc/invoke.texi (Overall Options): Mention .go as a file name suffix. Mention go as a -x option. * doc/frontends.texi (G++ and GCC): Mention Go as a supported language. * doc/sourcebuild.texi (Top Level): Mention libgo. * doc/standards.texi (Standards): Add section on Go language. Move references for other languages into their own section. * doc/contrib.texi (Contributors): Mention that I contributed the Go frontend. gcc/testsuite/: * lib/go.exp: New file. * lib/go-dg.exp: New file. * lib/go-torture.exp: New file. * lib/target-supports.exp (check_compile): Match // Go. From-SVN: r167407