diff options
author | Luuk van Dijk <lvd@golang.org> | 2010-10-17 22:35:55 +0200 |
---|---|---|
committer | Luuk van Dijk <lvd@golang.org> | 2010-10-17 22:35:55 +0200 |
commit | a647f59c1f80dd575c6e4107618681aea65edbd2 (patch) | |
tree | 78e0eb45568291ec96941015956695f4cd3fad50 | |
parent | cc9e6b5cdb4e6a5f296df86679f132b79632deb6 (diff) | |
download | go-a647f59c1f80dd575c6e4107618681aea65edbd2.tar.gz go-a647f59c1f80dd575c6e4107618681aea65edbd2.zip |
[68]l: proper end of instruction ranges in dwarf.
R=rsc
CC=golang-dev
https://golang.org/cl/2542042
-rw-r--r-- | src/cmd/ld/dwarf.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/cmd/ld/dwarf.c b/src/cmd/ld/dwarf.c index 1e7c35e47e..cd9c82e02d 100644 --- a/src/cmd/ld/dwarf.c +++ b/src/cmd/ld/dwarf.c @@ -667,7 +667,7 @@ flushunit(vlong pc, vlong unitstart) static void writelines(void) { - Prog *p, *q; + Prog *q; Sym *s; char *unitname; vlong unitstart; @@ -676,7 +676,6 @@ writelines(void) int i; Linehist *lh; - q = nil; unitstart = -1; epc = pc = 0; lc = 1; @@ -741,20 +740,18 @@ writelines(void) if (!s->reachable) continue; - p = s->text; - if (unitstart < 0) { - diag("reachable code before seeing any history: %P", p); + diag("reachable code before seeing any history: %P", s->text); continue; } dwinfo->child = newdie(dwinfo->child, DW_ABRV_FUNCTION); newattr(dwinfo->child, DW_AT_name, DW_CLS_STRING, strlen(s->name), s->name); - newattr(dwinfo->child, DW_AT_low_pc, DW_CLS_ADDRESS, s->text->pc, 0); - newattr(dwinfo->child, DW_AT_high_pc, DW_CLS_ADDRESS, s->text->pc + s->size, 0); + newattr(dwinfo->child, DW_AT_low_pc, DW_CLS_ADDRESS, s->value, 0); + epc = s->value + s->size; + newattr(dwinfo->child, DW_AT_high_pc, DW_CLS_ADDRESS, epc, 0); - for(q = p; q != P && (q == p || q->as != ATEXT); q = q->link) { - epc = q->pc; + for(q = s->text; q != P; q = q->link) { lh = searchhist(q->line); if (lh == nil) { diag("corrupt history or bad absolute line: %P", q); |