From 1391789ee21612ced0d753687479b113f66b017b Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Thu, 16 Jan 2014 22:28:33 +0000 Subject: [PATCH] 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__". --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index 8cc3fad697f8..eba5bbdfeb3f 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -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); }