mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
Fix the bugs I introduced fixing the bug earlier tonight.
This commit is contained in:
parent
ae12b87972
commit
eaf56db5bc
4 changed files with 11 additions and 6 deletions
|
@ -15,10 +15,8 @@ dwarf386regs[] =
|
||||||
"BP",
|
"BP",
|
||||||
"SI",
|
"SI",
|
||||||
"DI",
|
"DI",
|
||||||
"LR",
|
|
||||||
"CFA",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int dwarf386nregs = 10;
|
int dwarf386nregs = nelem(dwarf386regs);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ findabbrev(DwarfAbbrev *a, int na, ulong num)
|
||||||
for(i=0; i<na; i++)
|
for(i=0; i<na; i++)
|
||||||
if(a[i].num == num)
|
if(a[i].num == num)
|
||||||
return &a[i];
|
return &a[i];
|
||||||
|
werrstr("abbrev not found");
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,8 +123,10 @@ dwarfgetabbrev(Dwarf *d, ulong off, ulong num)
|
||||||
DwarfAbbrev *a;
|
DwarfAbbrev *a;
|
||||||
int na;
|
int na;
|
||||||
|
|
||||||
if((na = loadabbrevs(d, off, &a)) < 0)
|
if((na = loadabbrevs(d, off, &a)) < 0){
|
||||||
|
werrstr("loadabbrevs: %r");
|
||||||
return nil;
|
return nil;
|
||||||
|
}
|
||||||
return findabbrev(a, na, num);
|
return findabbrev(a, na, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,8 @@ top:
|
||||||
|
|
||||||
a = dwarfgetabbrev(d, s->aoff, num);
|
a = dwarfgetabbrev(d, s->aoff, num);
|
||||||
if(a == nil){
|
if(a == nil){
|
||||||
fprint(2, "getabbrev %ud: %r\n", num);
|
fprint(2, "getabbrev %ud %ud for %ud,%ud: %r\n", s->aoff, num, s->unit, s->uoff);
|
||||||
|
abort();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(parseattrs(&s->b, s->unit, a, &s->attrs) < 0)
|
if(parseattrs(&s->b, s->unit, a, &s->attrs) < 0)
|
||||||
|
|
|
@ -112,6 +112,9 @@ dwarflenum(Fhdr *fhdr, Symbol *p, char *name, uint j, Loc l, Symbol *s)
|
||||||
if(p == nil)
|
if(p == nil)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if(p->u.dwarf.unit == 0 && p->u.dwarf.uoff == 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if(dwarfseeksym(fhdr->dwarf, p->u.dwarf.unit, p->u.dwarf.uoff, &ds) < 0)
|
if(dwarfseeksym(fhdr->dwarf, p->u.dwarf.unit, p->u.dwarf.uoff, &ds) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -200,7 +203,7 @@ dwarfsyminit(Fhdr *fp)
|
||||||
if(dwarfenum(d, &s) < 0)
|
if(dwarfenum(d, &s) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dwarfnextsymat(d, &s, 0);
|
while(dwarfnextsymat(d, &s, 0) == 1)
|
||||||
while(dwarfnextsymat(d, &s, 1) == 1){
|
while(dwarfnextsymat(d, &s, 1) == 1){
|
||||||
if(s.attrs.name == nil)
|
if(s.attrs.name == nil)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue