diff options
author | Russ Cox <rsc@golang.org> | 2014-09-26 13:48:30 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-09-26 13:48:30 -0400 |
commit | 282f3609f529697b65643b2c72235a21ce318707 (patch) | |
tree | 3e84b285d92f0a09df672636be24872d53ad9646 /src/cmd/ld | |
parent | 2d475eb2623625e3a6f3c6c46545a692371b4e1f (diff) | |
download | go-282f3609f529697b65643b2c72235a21ce318707.tar.gz |
cmd/go: display program name when reporting crash
Fix by atom (from CL 89190044), comment and test by me.
Fixes issue 6823.
LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=0xe2.0x9a.0x9b, adg, golang-codereviews, iant, r
https://codereview.appspot.com/148180043
Diffstat (limited to 'src/cmd/ld')
-rw-r--r-- | src/cmd/ld/pobj.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/ld/pobj.c b/src/cmd/ld/pobj.c index 54c5ef247..63460df30 100644 --- a/src/cmd/ld/pobj.c +++ b/src/cmd/ld/pobj.c @@ -45,6 +45,8 @@ char* paramspace = "FP"; void main(int argc, char *argv[]) { + int i; + linkarchinit(); ctxt = linknew(thelinkarch); ctxt->thechar = thechar; @@ -64,6 +66,13 @@ main(int argc, char *argv[]) INITENTRY = 0; linkmode = LinkAuto; + // For testing behavior of go command when tools crash. + // Undocumented, not in standard flag parser to avoid + // exposing in usage message. + for(i=1; i<argc; i++) + if(strcmp(argv[i], "-crash_for_testing") == 0) + *(volatile int*)0 = 0; + if(thechar == '5' && ctxt->goarm == 5) debug['F'] = 1; |