Patchwork libgo patch committed: Correct runtime.Callers skip argument

login
register
mail settings
Submitter Ian Taylor
Date Feb. 2, 2013, 3:11 p.m.
Message ID <mcrd2wi3g3r.fsf@google.com>
Download mbox | patch
Permalink /patch/217672/
State New
Headers show

Comments

Ian Taylor - Feb. 2, 2013, 3:11 p.m.
With the change to using the libbacktrace code, inlined functions now
picked up.  Previously the skip parameter to runtime.Callers was
adjusted based on inlining that was ignored.  This patch corrects it so
that the right thing happens.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Patch

diff -r 13363f80cdf6 libgo/runtime/go-callers.c
--- a/libgo/runtime/go-callers.c	Thu Jan 31 21:48:23 2013 -0800
+++ b/libgo/runtime/go-callers.c	Sat Feb 02 07:09:40 2013 -0800
@@ -115,8 +115,9 @@ 
 
   /* In the Go 1 release runtime.Callers has an off-by-one error,
      which we can not correct because it would break backward
-     compatibility.  Adjust SKIP here to be compatible.  */
-  ret = runtime_callers (skip - 1, locbuf, pc.__count);
+     compatibility.  Normally we would add 1 to SKIP here, but we
+     don't so that we are compatible.  */
+  ret = runtime_callers (skip, locbuf, pc.__count);
 
   for (i = 0; i < ret; i++)
     ((uintptr *) pc.__values)[i] = locbuf[i].pc;