diff options
| author | Anthony Martin <ality@pbrane.org> | 2014-03-12 18:10:31 -0700 |
|---|---|---|
| committer | Anthony Martin <ality@pbrane.org> | 2014-03-12 18:10:31 -0700 |
| commit | b67979320a9214b7d1b75bbd2d11ea5a1aa40323 (patch) | |
| tree | ab89863df2921db588716f233c11c1770d54fb9f /src/cmd/ld/lib.c | |
| parent | 15068b6df752bd91ae1bbe7ac6d50f853f027d98 (diff) | |
| download | go-b67979320a9214b7d1b75bbd2d11ea5a1aa40323.tar.xz | |
cmd/ld: give acid a fighting chance at unwinding the stack
Acid can't produce a stack trace without .frame symbols.
Of course, it can only unwind through linear stacks but
this is still better than nothing. (I wrote an acid func
to do the full unwind a long time ago but lost it and
haven't worked up the courage to write it again).
Note that these will only be present in the native symbol
table for Plan 9 binaries.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/72450045
Diffstat (limited to 'src/cmd/ld/lib.c')
| -rw-r--r-- | src/cmd/ld/lib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index e0fcd15da5..20383de1e1 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -1341,6 +1341,9 @@ genasmsym(void (*put)(LSym*, char*, int, vlong, vlong, int, LSym*)) for(s = ctxt->textp; s != nil; s = s->next) { put(s, s->name, 'T', s->value, s->size, s->version, s->gotype); + // NOTE(ality): acid can't produce a stack trace without .frame symbols + put(nil, ".frame", 'm', s->locals+PtrSize, 0, 0, 0); + for(a=s->autom; a; a=a->link) { // Emit a or p according to actual offset, even if label is wrong. // This avoids negative offsets, which cannot be encoded. |
