diff options
author | emaste <emaste@FreeBSD.org> | 2015-09-22 16:51:40 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-09-22 16:51:40 +0000 |
commit | 10b8b85018a68155b9aab67a85779ba4d1cfcdd8 (patch) | |
tree | aa6c6592bcc283146c0849e2d3ddbaf8f46afe24 /contrib/elftoolchain | |
parent | e6d5be3edcfce6f6412bb26166f24336dd3f1e79 (diff) | |
download | FreeBSD-src-10b8b85018a68155b9aab67a85779ba4d1cfcdd8.zip FreeBSD-src-10b8b85018a68155b9aab67a85779ba4d1cfcdd8.tar.gz |
addr2line: skip CUs lacking debug info instead of bailing out
Some binaries (such as the FreeBSD kernel) contain a mixture of CUs
with and without debug information. Previously translate() exited upon
encountering a CU without debug information. Instead, just move on to
the next CU.
Reported by: royger
Reviewed by: royger
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3712
Diffstat (limited to 'contrib/elftoolchain')
-rw-r--r-- | contrib/elftoolchain/addr2line/addr2line.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/elftoolchain/addr2line/addr2line.c b/contrib/elftoolchain/addr2line/addr2line.c index cfdcc74..86e7282 100644 --- a/contrib/elftoolchain/addr2line/addr2line.c +++ b/contrib/elftoolchain/addr2line/addr2line.c @@ -248,7 +248,13 @@ translate(Dwarf_Debug dbg, const char* addrstr) continue; } - if (dwarf_srclines(die, &lbuf, &lcount, &de) != DW_DLV_OK) { + switch (dwarf_srclines(die, &lbuf, &lcount, &de)) { + case DW_DLV_OK: + break; + case DW_DLV_NO_ENTRY: + /* If one CU lacks debug info, just skip it. */ + continue; + default: warnx("dwarf_srclines: %s", dwarf_errmsg(de)); goto out; } |