Commit 45143aec authored by David du Colombier's avatar David du Colombier

runtime: fix handling of GOTRACEBACK

Since CL 130990043, the GOTRACEBACK variable is
only used when the GODEBUG variable is set.
This change restores the original behavior.

LGTM=rsc
R=golang-codereviews, aram, gobot, r, rsc
CC=golang-codereviews
https://golang.org/cl/132520043
parent c3b5db89
...@@ -287,18 +287,18 @@ runtime·parsedebugvars(void) ...@@ -287,18 +287,18 @@ runtime·parsedebugvars(void)
intgo i, n; intgo i, n;
p = runtime·getenv("GODEBUG"); p = runtime·getenv("GODEBUG");
if(p == nil) if(p != nil){
return; for(;;) {
for(;;) { for(i=0; i<nelem(dbgvar); i++) {
for(i=0; i<nelem(dbgvar); i++) { n = runtime·findnull((byte*)dbgvar[i].name);
n = runtime·findnull((byte*)dbgvar[i].name); if(runtime·mcmp(p, (byte*)dbgvar[i].name, n) == 0 && p[n] == '=')
if(runtime·mcmp(p, (byte*)dbgvar[i].name, n) == 0 && p[n] == '=') *dbgvar[i].value = runtime·atoi(p+n+1);
*dbgvar[i].value = runtime·atoi(p+n+1); }
p = runtime·strstr(p, (byte*)",");
if(p == nil)
break;
p++;
} }
p = runtime·strstr(p, (byte*)",");
if(p == nil)
break;
p++;
} }
p = runtime·getenv("GOTRACEBACK"); p = runtime·getenv("GOTRACEBACK");
......
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