aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenghou Ma <minux@golang.org>2015-05-24 03:58:03 -0400
committerMinux Ma <minux@golang.org>2015-06-16 16:50:21 +0000
commitd00e7ad640cf0bb91fff33aaac4bbb6da8d415c2 (patch)
tree296d28e1485cdf56445813f378bf223e73a1f6a5
parent0d8366e2d66bb56fcda7669837dfeb289e9131e3 (diff)
downloadgo-d00e7ad640cf0bb91fff33aaac4bbb6da8d415c2.tar.xz
cmd/compile: show compiler panics when -d panic=1
Fixes #10683. Change-Id: I4cce3f298b787c736dbabe544a11a9215bcd3671 Reviewed-on: https://go-review.googlesource.com/10336 Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--src/cmd/compile/internal/gc/lex.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/gc/lex.go b/src/cmd/compile/internal/gc/lex.go
index afc5de95c5..0c43aa443b 100644
--- a/src/cmd/compile/internal/gc/lex.go
+++ b/src/cmd/compile/internal/gc/lex.go
@@ -36,9 +36,10 @@ var (
)
var (
- Debug_wb int
Debug_append int
+ Debug_panic int
Debug_slice int
+ Debug_wb int
)
// Debug arguments.
@@ -53,6 +54,7 @@ var debugtab = []struct {
{"disablenil", &Disable_checknil}, // disable nil checks
{"gcprog", &Debug_gcprog}, // print dump of GC programs
{"nil", &Debug_checknil}, // print information about nil checks
+ {"panic", &Debug_panic}, // do not hide any compiler panic
{"slice", &Debug_slice}, // print information about slice compilation
{"typeassert", &Debug_typeassert}, // print information about type assertion inlining
{"wb", &Debug_wb}, // print information about write barriers
@@ -89,7 +91,7 @@ func usage() {
}
func hidePanic() {
- if nsavederrors+nerrors > 0 {
+ if Debug_panic == 0 && nsavederrors+nerrors > 0 {
// If we've already complained about things
// in the program, don't bother complaining
// about a panic too; let the user clean up