]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: adjust GC debug print to include source pointers
authorRuss Cox <rsc@golang.org>
Wed, 16 Apr 2014 15:39:43 +0000 (11:39 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 16 Apr 2014 15:39:43 +0000 (11:39 -0400)
Having the pointers means you can grub around in the
binary finding out more about them.

This helped with issue 7748.

LGTM=minux.ma, bradfitz
R=golang-codereviews, minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/88090045

src/pkg/runtime/mgc0.c

index be7f27e396f58f4007f2280a878b3865503bfc3f..359d426fc8d4eed449ff0b6dcd1b860806db1273 100644 (file)
@@ -702,8 +702,8 @@ checkptr(void *obj, uintptr objti)
                // A simple best-effort check until first GC_END.
                for(j = 1; pc1[j] != GC_END && pc2[j] != GC_END; j++) {
                        if(pc1[j] != pc2[j]) {
-                               runtime·printf("invalid gc type info for '%s' at %p, type info %p, block info %p\n",
-                                              t->string ? (int8*)t->string->str : (int8*)"?", j, pc1[j], pc2[j]);
+                               runtime·printf("invalid gc type info for '%s', type info %p [%d]=%p, block info %p [%d]=%p\n",
+                                              t->string ? (int8*)t->string->str : (int8*)"?", pc1, (int32)j, pc1[j], pc2, (int32)j, pc2[j]);
                                runtime·throw("invalid gc type info");
                        }
                }