From owner-svn-src-head@freebsd.org Tue Sep 22 16:51:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C15A0A07648; Tue, 22 Sep 2015 16:51:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B28171183; Tue, 22 Sep 2015 16:51:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MGpf2A034995; Tue, 22 Sep 2015 16:51:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MGpfLS034994; Tue, 22 Sep 2015 16:51:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201509221651.t8MGpfLS034994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 22 Sep 2015 16:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288119 - head/contrib/elftoolchain/addr2line X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 16:51:41 -0000 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; }