svn commit: r260797 - projects/elftoolchain/cddl/contrib/opensolaris/tools/ctf/cvt

Kai Wang kaiw at FreeBSD.org
Thu Jan 16 22:28:34 UTC 2014


Author: kaiw
Date: Thu Jan 16 22:28:33 2014
New Revision: 260797
URL: http://svnweb.freebsd.org/changeset/base/260797

Log:
  If function die_name() finds a DIE without a name, set its name to
  "__anon__". This hack is used to workaround a issue that compilers
  like GCC could generate DW_TAG_base_type DIE without a name.
  
  Note that we didn't need this before because the old libdwarf
  internally set all the unnamed DIE's name to "__anon__".

Modified:
  projects/elftoolchain/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c

Modified: projects/elftoolchain/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
==============================================================================
--- projects/elftoolchain/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c	Thu Jan 16 22:14:54 2014	(r260796)
+++ projects/elftoolchain/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c	Thu Jan 16 22:28:33 2014	(r260797)
@@ -431,6 +431,8 @@ die_name(dwarf_t *dw, Dwarf_Die die)
 	char *str = NULL;
 
 	(void) die_string(dw, die, DW_AT_name, &str, 0);
+	if (str == NULL)
+		str = xstrdup("__anon__");
 
 	return (str);
 }


More information about the svn-src-projects mailing list