diff options
author | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
commit | a926878ddbd5a98b272c22171ce58663fc04c3e0 (patch) | |
tree | 86af256e5d9a9c06263c00adc90e5fe348008c43 /libgo/go/runtime/debuglog.go | |
parent | 542730f087133690b47e036dfd43eb0db8a650ce (diff) | |
parent | 07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff) | |
download | gcc-devel/autopar_devel.zip gcc-devel/autopar_devel.tar.gz gcc-devel/autopar_devel.tar.bz2 |
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'libgo/go/runtime/debuglog.go')
-rw-r--r-- | libgo/go/runtime/debuglog.go | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libgo/go/runtime/debuglog.go b/libgo/go/runtime/debuglog.go index 404d057..d8c87c7 100644 --- a/libgo/go/runtime/debuglog.go +++ b/libgo/go/runtime/debuglog.go @@ -672,13 +672,17 @@ func (r *debugLogReader) printVal() bool { print("..(", r.uvarint(), " more bytes)..") case debugLogPC: - printDebugLogPC(uintptr(r.uvarint())) + printDebugLogPC(uintptr(r.uvarint()), false) case debugLogTraceback: n := int(r.uvarint()) for i := 0; i < n; i++ { print("\n\t") - printDebugLogPC(uintptr(r.uvarint())) + // gentraceback PCs are always return PCs. + // Convert them to call PCs. + // + // TODO(austin): Expand inlined frames. + printDebugLogPC(uintptr(r.uvarint()), true) } } @@ -801,9 +805,18 @@ func printDebugLog() { printunlock() } -func printDebugLogPC(pc uintptr) { - print(hex(pc)) +// printDebugLogPC prints a single symbolized PC. If returnPC is true, +// pc is a return PC that must first be converted to a call PC. +func printDebugLogPC(pc uintptr, returnPC bool) { name, file, line, _ := funcfileline(pc, -1, false) + entry := funcentry(pc) + if returnPC && (name == "" || (entry != 0 && pc > funcentry(pc))) { + // TODO(austin): Don't back up if the previous frame + // was a sigpanic. + pc-- + } + + print(hex(pc)) if name == "" { print(" [unknown PC]") } else { |