aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-04-02 23:00:40 -0400
committerRuss Cox <rsc@golang.org>2014-04-02 23:00:40 -0400
commitc40480ddd9489f4c8c74b061d4397567ccb835cd (patch)
tree35a1c050713aad98a0873567b0e2ef6db75ddb6f /src/pkg/runtime
parent059c10b552d8e8331a5621fa73d1fcb914cc913e (diff)
downloadgo-c40480ddd9489f4c8c74b061d4397567ccb835cd.tar.xz
runtime: print up to 10 words of arguments
The old limit of 5 was chosen because we didn't actually know how many bytes of arguments there were; 5 was a halfway point between printing some useful information and looking ridiculous. Now we know how many bytes of arguments there are, and we stop the printing when we reach that point, so the "looking ridiculous" case doesn't happen anymore: we only print actual argument words. The cutoff now serves only to truncate very long (but real) argument lists. In multiple debugging sessions recently (completely unrelated bugs) I have been frustrated by not seeing more of the long argument lists: 5 words is only 2.5 interface values or strings, and not even 2 slices. Double the max amount we'll show. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews, iant, r https://golang.org/cl/83850043
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/traceback_arm.c2
-rw-r--r--src/pkg/runtime/traceback_x86.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/traceback_arm.c b/src/pkg/runtime/traceback_arm.c
index f5cd4133d4..dd77fcdfd8 100644
--- a/src/pkg/runtime/traceback_arm.c
+++ b/src/pkg/runtime/traceback_arm.c
@@ -156,7 +156,7 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip,
tracepc -= sizeof(uintptr);
runtime·printf("%s(", runtime·funcname(f));
for(i = 0; i < frame.arglen/sizeof(uintptr); i++) {
- if(i >= 5) {
+ if(i >= 10) {
runtime·prints(", ...");
break;
}
diff --git a/src/pkg/runtime/traceback_x86.c b/src/pkg/runtime/traceback_x86.c
index 4c8074e9e4..93f33cee16 100644
--- a/src/pkg/runtime/traceback_x86.c
+++ b/src/pkg/runtime/traceback_x86.c
@@ -217,7 +217,7 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip,
tracepc--;
runtime·printf("%s(", runtime·funcname(f));
for(i = 0; i < frame.arglen/sizeof(uintptr); i++) {
- if(i >= 5) {
+ if(i >= 10) {
runtime·prints(", ...");
break;
}