runtime: print C functions in traceback
commit7f5fcbbd91c8e2df013614e5d403b5d445511460
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 20:28:28 +0000 (30 20:28 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 20:28:28 +0000 (30 20:28 +0000)
treeaf388d60fbccb515b0412b2eb67e16a81240830d
parent8783abe2195bfe3aac2adbf46d118693e9f5b445
runtime: print C functions in traceback

    Since gccgo can trace back through C code as easily as Go code, we
    should print C functions in the traceback.

    This worked before https://golang.org/cl/31230 for a dumb reason.  The
    default value for runtime.traceback_cache was, and is, 2 << 2, meaning
    to print all functions.  The old C code for runtime_parsedebugvars
    would return immediately and do nothing if the environment variable
    GODEBUG was not set (if GODEBUG was set it would later call
    setTraceback.  The new Go code for runtime.parsedebugvars does not
    return immediately if GODEBUG is not set, and always calls
    setTraceback.  Either way, if GOTRACEBACK is not set, setTraceback
    would set traceback_cache to 1 << 2, meaning to only print non-runtime
    functions and having the effect of not printing plain C functions.

    Keep the current handling of GODEBUG/GOTRACEBACK, which matches the gc
    library, but add an extra check to print C functions by default.

    Reviewed-on: https://go-review.googlesource.com/33717

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243083 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/traceback_gccgo.go