mirror of
https://github.com/golang/go
synced 2024-11-24 21:00:09 -07:00
[68]l: proper end of instruction ranges in dwarf.
R=rsc CC=golang-dev https://golang.org/cl/2542042
This commit is contained in:
parent
cc9e6b5cdb
commit
a647f59c1f
@ -667,7 +667,7 @@ flushunit(vlong pc, vlong unitstart)
|
|||||||
static void
|
static void
|
||||||
writelines(void)
|
writelines(void)
|
||||||
{
|
{
|
||||||
Prog *p, *q;
|
Prog *q;
|
||||||
Sym *s;
|
Sym *s;
|
||||||
char *unitname;
|
char *unitname;
|
||||||
vlong unitstart;
|
vlong unitstart;
|
||||||
@ -676,7 +676,6 @@ writelines(void)
|
|||||||
int i;
|
int i;
|
||||||
Linehist *lh;
|
Linehist *lh;
|
||||||
|
|
||||||
q = nil;
|
|
||||||
unitstart = -1;
|
unitstart = -1;
|
||||||
epc = pc = 0;
|
epc = pc = 0;
|
||||||
lc = 1;
|
lc = 1;
|
||||||
@ -741,20 +740,18 @@ writelines(void)
|
|||||||
if (!s->reachable)
|
if (!s->reachable)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
p = s->text;
|
|
||||||
|
|
||||||
if (unitstart < 0) {
|
if (unitstart < 0) {
|
||||||
diag("reachable code before seeing any history: %P", p);
|
diag("reachable code before seeing any history: %P", s->text);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwinfo->child = newdie(dwinfo->child, DW_ABRV_FUNCTION);
|
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_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_low_pc, DW_CLS_ADDRESS, s->value, 0);
|
||||||
newattr(dwinfo->child, DW_AT_high_pc, DW_CLS_ADDRESS, s->text->pc + s->size, 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) {
|
for(q = s->text; q != P; q = q->link) {
|
||||||
epc = q->pc;
|
|
||||||
lh = searchhist(q->line);
|
lh = searchhist(q->line);
|
||||||
if (lh == nil) {
|
if (lh == nil) {
|
||||||
diag("corrupt history or bad absolute line: %P", q);
|
diag("corrupt history or bad absolute line: %P", q);
|
||||||
|
Loading…
Reference in New Issue
Block a user