better unwinding for 386.
command-line extraction from core files on linux and freebsd. move linux ureg into ureg386.h (used in many places).
This commit is contained in:
parent
cdf1805191
commit
1cc215aaf9
13 changed files with 495 additions and 109 deletions
|
|
@ -50,6 +50,23 @@ _delhdr(Fhdr *h)
|
|||
h->next = nil;
|
||||
}
|
||||
|
||||
Fhdr*
|
||||
findhdr(char *name)
|
||||
{
|
||||
int len, plen;
|
||||
Fhdr *p;
|
||||
|
||||
len = strlen(name);
|
||||
for(p=fhdrlist; p; p=p->next){
|
||||
plen = strlen(p->filename);
|
||||
if(plen >= len)
|
||||
if(strcmp(p->filename+plen-len, name) == 0)
|
||||
if(plen == len || p->filename[plen-len-1] == '/')
|
||||
return p;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
int
|
||||
pc2file(ulong pc, char *file, uint nfile, ulong *line)
|
||||
{
|
||||
|
|
@ -354,14 +371,14 @@ findlsym(Symbol *s1, Loc loc, Symbol *s2)
|
|||
}
|
||||
|
||||
int
|
||||
unwindframe(Map *map, Regs *regs, ulong *next)
|
||||
unwindframe(Map *map, Regs *regs, ulong *next, Symbol *sym)
|
||||
{
|
||||
Fhdr *p;
|
||||
|
||||
for(p=fhdrlist; p; p=p->next)
|
||||
if(p->unwind && p->unwind(p, map, regs, next) >= 0)
|
||||
if(p->unwind && p->unwind(p, map, regs, next, sym) >= 0)
|
||||
return 0;
|
||||
if(mach->unwind && mach->unwind(map, regs, next) >= 0)
|
||||
if(mach->unwind && mach->unwind(map, regs, next, sym) >= 0)
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue