]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: show compiler panics when -d panic=1
authorShenghou Ma <minux@golang.org>
Sun, 24 May 2015 07:58:03 +0000 (03:58 -0400)
committerMinux Ma <minux@golang.org>
Tue, 16 Jun 2015 16:50:21 +0000 (16:50 +0000)
Fixes #10683.

Change-Id: I4cce3f298b787c736dbabe544a11a9215bcd3671
Reviewed-on: https://go-review.googlesource.com/10336
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/lex.go

index afc5de95c5ef3f91d2ab0b53e28aa142d4712452..0c43aa443be0111f7266461520fe096e306f1ebd 100644 (file)
@@ -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