From owner-svn-src-all@FreeBSD.ORG Thu Mar 14 21:18:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8ABDB3D; Thu, 14 Mar 2013 21:18:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9DA1C06; Thu, 14 Mar 2013 21:18:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2ELIJJY023044; Thu, 14 Mar 2013 21:18:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2ELIJco023043; Thu, 14 Mar 2013 21:18:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303142118.r2ELIJco023043@svn.freebsd.org> From: Dimitry Andric Date: Thu, 14 Mar 2013 21:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248284 - stable/9/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Mar 2013 21:18:19 -0000 Author: dim Date: Thu Mar 14 21:18:19 2013 New Revision: 248284 URL: http://svnweb.freebsd.org/changeset/base/248284 Log: MFC r247960: Make ctfconvert work correctly on clang-compiled object files. Clang puts the full original source filename in the STT_FILE entry of the ELF symbol table, while gcc saves only the basename. Since the DWARF DW_AT_name attribute contains the full source filename, both for clang and gcc, ctfconvert takes just the basename of it, for matching with the STT_FILE entry. So when attempting to match with such an entry, use its basename, if necessary. Reported by: avg MFC r247962: Fix error in r247960: actually assign the basename to match.iim_file. Pointed out by: avg Pointy hat to: dim Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 14 20:31:39 2013 (r248283) +++ stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 14 21:18:19 2013 (r248284) @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, for (i = 0; i < nent; i++) { GElf_Sym sym; + char *bname; iidesc_t **tolist; GElf_Sym ssym; iidesc_match_t smatch; @@ -377,7 +378,8 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: - match.iim_file = match.iim_name; + bname = strrchr(match.iim_name, '/'); + match.iim_file = bname == NULL ? match.iim_name : bname + 1; continue; case STT_OBJECT: tolist = iiburst->iib_objts;