Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2015 16:51:41 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288119 - head/contrib/elftoolchain/addr2line
Message-ID:  <201509221651.t8MGpfLS034994@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509221651.t8MGpfLS034994>