summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authorkaiw <kaiw@FreeBSD.org>2014-01-16 22:28:33 +0000
committerkaiw <kaiw@FreeBSD.org>2014-01-16 22:28:33 +0000
commit403645c54c11c0adf61df0de4a94ceb62a8ceae2 (patch)
treee905882b3ddcf8ef4b2bbe2d4f93b5bb1f1ca857 /cddl
parentac8de91b29f18857f156860dc4cd69647e9e11d8 (diff)
downloadFreeBSD-src-403645c54c11c0adf61df0de4a94ceb62a8ceae2.zip
FreeBSD-src-403645c54c11c0adf61df0de4a94ceb62a8ceae2.tar.gz
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__".
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
index 8cc3fad..eba5bbd 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);
}
OpenPOWER on IntegriCloud