diff options
author | rsc <devnull@localhost> | 2004-12-25 22:03:28 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-12-25 22:03:28 +0000 |
commit | 1cc215aaf92a6cf3cea436f2c215a84839fd59bc (patch) | |
tree | dd8524135949b5bd7b3cb3b23e02b09f9646891e /src/libmach/sym.c | |
parent | cdf1805191ba4ab5b8fbb1697a95fe0d32e25ee6 (diff) | |
download | plan9port-1cc215aaf92a6cf3cea436f2c215a84839fd59bc.tar.gz plan9port-1cc215aaf92a6cf3cea436f2c215a84839fd59bc.tar.bz2 plan9port-1cc215aaf92a6cf3cea436f2c215a84839fd59bc.zip |
better unwinding for 386.
command-line extraction from core files on linux and freebsd.
move linux ureg into ureg386.h (used in many places).
Diffstat (limited to 'src/libmach/sym.c')
-rw-r--r-- | src/libmach/sym.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/libmach/sym.c b/src/libmach/sym.c index b734957f..a5cf0314 100644 --- a/src/libmach/sym.c +++ b/src/libmach/sym.c @@ -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; } |