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
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;
}