Commit dacc020c authored by Russ Cox's avatar Russ Cox

cmd/ld: record complete runtime-gdb.py path again

This code never got updated after the liblink shuffle.
Tested by hand that it works and respects GOROOT_FINAL.

The discussion in issue 6963 suggests that perhaps we should
just drop runtime-gdb.py entirely, but I am not convinced
that is true. It was in Go 1.2 and I don't see a reason not to
keep it in Go 1.3. The fact that binaries have not been emitting
the reference was just a missed detail in the liblink conversion,
not part of a grand plan.

Fixes #7506.
Fixes #6963.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews, iant, r
https://golang.org/cl/87870048
parent e97b3ab1
...@@ -1393,26 +1393,26 @@ movetomodule(DWDie *parent) ...@@ -1393,26 +1393,26 @@ movetomodule(DWDie *parent)
die->link = parent->child; die->link = parent->child;
} }
// if the histfile stack contains ..../runtime/runtime_defs.go // If the pcln table contains runtime/zruntime_defs_*.go, use that to set gdbscript path.
// use that to set gdbscript
static void static void
finddebugruntimepath(LSym *s) finddebugruntimepath(LSym *s)
{ {
USED(s); int i;
char *p;
LSym *f;
/* TODO if(gdbscript[0] != '\0')
int i, l; return;
char *c;
for (i = 1; i < histfilesize; i++) { for(i=0; i<s->pcln->nfile; i++) {
if ((c = strstr(histfile[i], "runtime/zruntime_defs")) != nil) { f = s->pcln->file[i];
l = c - histfile[i]; if((p = strstr(f->name, "runtime/string.goc")) != nil) {
memmove(gdbscript, histfile[i], l); *p = '\0';
memmove(gdbscript + l, "runtime/runtime-gdb.py", strlen("runtime/runtime-gdb.py") + 1); snprint(gdbscript, sizeof gdbscript, "%sruntime/runtime-gdb.py", f->name);
*p = 'r';
break; break;
} }
} }
*/
} }
/* /*
......
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