svn commit: r288119 - head/contrib/elftoolchain/addr2line

Ed Maste emaste at FreeBSD.org
Tue Sep 22 16:51:41 UTC 2015


Author: emaste
Date: Tue Sep 22 16:51:40 2015
New Revision: 288119
URL: https://svnweb.freebsd.org/changeset/base/288119

Log:
  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

Modified:
  head/contrib/elftoolchain/addr2line/addr2line.c

Modified: head/contrib/elftoolchain/addr2line/addr2line.c
==============================================================================
--- head/contrib/elftoolchain/addr2line/addr2line.c	Tue Sep 22 16:50:59 2015	(r288118)
+++ head/contrib/elftoolchain/addr2line/addr2line.c	Tue Sep 22 16:51:40 2015	(r288119)
@@ -248,7 +248,13 @@ translate(Dwarf_Debug dbg, const char* a
 				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;
 		}


More information about the svn-src-head mailing list