diff options
author | Russ Cox <rsc@golang.org> | 2014-04-15 21:17:18 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-04-15 21:17:18 -0400 |
commit | be6067d6bc7626b5d7bc96689b0d50aca040a9c9 (patch) | |
tree | 23a89ff4ee1338e7630d1a533215bad3cea112e8 /src/cmd/ld/dwarf.c | |
parent | 5fee958207e7e22ca7676244afdcf8491ecf3aad (diff) | |
download | go-be6067d6bc7626b5d7bc96689b0d50aca040a9c9.tar.gz |
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 issue 7506.
Fixes issue 6963.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews, iant, r
https://codereview.appspot.com/87870048
Diffstat (limited to 'src/cmd/ld/dwarf.c')
-rw-r--r-- | src/cmd/ld/dwarf.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/cmd/ld/dwarf.c b/src/cmd/ld/dwarf.c index ff67223ad..fdbf932b5 100644 --- a/src/cmd/ld/dwarf.c +++ b/src/cmd/ld/dwarf.c @@ -1393,26 +1393,26 @@ movetomodule(DWDie *parent) die->link = parent->child; } -// if the histfile stack contains ..../runtime/runtime_defs.go -// use that to set gdbscript +// If the pcln table contains runtime/zruntime_defs_*.go, use that to set gdbscript path. static void finddebugruntimepath(LSym *s) { - USED(s); - -/* TODO - int i, l; - char *c; + int i; + char *p; + LSym *f; + + if(gdbscript[0] != '\0') + return; - for (i = 1; i < histfilesize; i++) { - if ((c = strstr(histfile[i], "runtime/zruntime_defs")) != nil) { - l = c - histfile[i]; - memmove(gdbscript, histfile[i], l); - memmove(gdbscript + l, "runtime/runtime-gdb.py", strlen("runtime/runtime-gdb.py") + 1); + for(i=0; i<s->pcln->nfile; i++) { + f = s->pcln->file[i]; + if((p = strstr(f->name, "runtime/string.goc")) != nil) { + *p = '\0'; + snprint(gdbscript, sizeof gdbscript, "%sruntime/runtime-gdb.py", f->name); + *p = 'r'; break; } } -*/ } /* |