Commit d00e7ad6 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

cmd/compile: show compiler panics when -d panic=1

Fixes #10683.

Change-Id: I4cce3f298b787c736dbabe544a11a9215bcd3671
Reviewed-on: https://go-review.googlesource.com/10336Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent 0d8366e2
...@@ -36,9 +36,10 @@ var ( ...@@ -36,9 +36,10 @@ var (
) )
var ( var (
Debug_wb int
Debug_append int Debug_append int
Debug_panic int
Debug_slice int Debug_slice int
Debug_wb int
) )
// Debug arguments. // Debug arguments.
...@@ -53,6 +54,7 @@ var debugtab = []struct { ...@@ -53,6 +54,7 @@ var debugtab = []struct {
{"disablenil", &Disable_checknil}, // disable nil checks {"disablenil", &Disable_checknil}, // disable nil checks
{"gcprog", &Debug_gcprog}, // print dump of GC programs {"gcprog", &Debug_gcprog}, // print dump of GC programs
{"nil", &Debug_checknil}, // print information about nil checks {"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 {"slice", &Debug_slice}, // print information about slice compilation
{"typeassert", &Debug_typeassert}, // print information about type assertion inlining {"typeassert", &Debug_typeassert}, // print information about type assertion inlining
{"wb", &Debug_wb}, // print information about write barriers {"wb", &Debug_wb}, // print information about write barriers
...@@ -89,7 +91,7 @@ func usage() { ...@@ -89,7 +91,7 @@ func usage() {
} }
func hidePanic() { func hidePanic() {
if nsavederrors+nerrors > 0 { if Debug_panic == 0 && nsavederrors+nerrors > 0 {
// If we've already complained about things // If we've already complained about things
// in the program, don't bother complaining // in the program, don't bother complaining
// about a panic too; let the user clean up // about a panic too; let the user clean up
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment