Skip to content

Commit dacc020

Browse files
committed
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
1 parent e97b3ab commit dacc020

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/cmd/ld/dwarf.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,26 +1393,26 @@ movetomodule(DWDie *parent)
13931393
die->link = parent->child;
13941394
}
13951395

1396-
// if the histfile stack contains ..../runtime/runtime_defs.go
1397-
// use that to set gdbscript
1396+
// If the pcln table contains runtime/zruntime_defs_*.go, use that to set gdbscript path.
13981397
static void
13991398
finddebugruntimepath(LSym *s)
14001399
{
1401-
USED(s);
1402-
1403-
/* TODO
1404-
int i, l;
1405-
char *c;
1400+
int i;
1401+
char *p;
1402+
LSym *f;
1403+
1404+
if(gdbscript[0] != '\0')
1405+
return;
14061406

1407-
for (i = 1; i < histfilesize; i++) {
1408-
if ((c = strstr(histfile[i], "runtime/zruntime_defs")) != nil) {
1409-
l = c - histfile[i];
1410-
memmove(gdbscript, histfile[i], l);
1411-
memmove(gdbscript + l, "runtime/runtime-gdb.py", strlen("runtime/runtime-gdb.py") + 1);
1407+
for(i=0; i<s->pcln->nfile; i++) {
1408+
f = s->pcln->file[i];
1409+
if((p = strstr(f->name, "runtime/string.goc")) != nil) {
1410+
*p = '\0';
1411+
snprint(gdbscript, sizeof gdbscript, "%sruntime/runtime-gdb.py", f->name);
1412+
*p = 'r';
14121413
break;
14131414
}
14141415
}
1415-
*/
14161416
}
14171417

14181418
/*

0 commit comments

Comments
 (0)