mirror of
https://github.com/golang/go.git
synced 2025-05-19 06:14:40 +00:00
cmd/compile: dump stack trace in Fatalf during development
See discussion in #15029. Change-Id: I5cc8be5737ddb7c1f5e4a6cd92cf557af45e961d Reviewed-on: https://go-review.googlesource.com/21347 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
43a274fd67
commit
00289c296c
@ -11,6 +11,7 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -151,6 +152,11 @@ func Fatalf(fmt_ string, args ...interface{}) {
|
|||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
fmt.Printf("Please file a bug report including a short program that triggers the error.\n")
|
fmt.Printf("Please file a bug report including a short program that triggers the error.\n")
|
||||||
fmt.Printf("https://golang.org/issue/new\n")
|
fmt.Printf("https://golang.org/issue/new\n")
|
||||||
|
} else {
|
||||||
|
// Not a release; dump a stack trace, too.
|
||||||
|
fmt.Println()
|
||||||
|
os.Stdout.Write(debug.Stack())
|
||||||
|
fmt.Println()
|
||||||
}
|
}
|
||||||
|
|
||||||
hcrash()
|
hcrash()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user