aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-04-17 19:29:28 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-04-17 19:29:28 +0000
commit5fdb119fd5fb0892b653e829beb4e8e9afaf9e4c (patch)
tree8b26ead6d9955e31ce7cf347d6e42a66c57a4c02 /libgo
parentf6c72af46fbbd30fd01f7bb8c678a252f7be67ba (diff)
downloadgcc-5fdb119fd5fb0892b653e829beb4e8e9afaf9e4c.zip
gcc-5fdb119fd5fb0892b653e829beb4e8e9afaf9e4c.tar.gz
gcc-5fdb119fd5fb0892b653e829beb4e8e9afaf9e4c.tar.bz2
re PR go/64999 (s390x libgo test failure in TestMemoryProfiler)
PR go/64999 PR go/65180 runtime: Adjust libbacktrace PC value to what runtime.Callers expects. From Lynn Boger. From-SVN: r222196
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-callers.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 34a2118..b5ab3be 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -83,7 +83,20 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
}
loc = &arg->locbuf[arg->index];
- loc->pc = pc;
+
+ /* On the call to backtrace_full the pc value was most likely
+ decremented if there was a normal call, since the pc referred to
+ the instruction where the call returned and not the call itself.
+ This was done so that the line number referred to the call
+ instruction. To make sure the actual pc from the call stack is
+ used, it is incremented here.
+
+ In the case of a signal, the pc was not decremented by
+ backtrace_full but still incremented here. That doesn't really
+ hurt anything since the line number is right and the pc refers to
+ the same instruction. */
+
+ loc->pc = pc + 1;
/* The libbacktrace library says that these strings might disappear,
but with the current implementation they won't. We can't easily