From 698a5adcf3ee29430a15fb0e35f7442bc60e9007 Mon Sep 17 00:00:00 2001 From: markj Date: Wed, 31 Aug 2016 01:27:30 +0000 Subject: [PATCH] MFC r304055: Fix handling of forward enum declarations in the CTF tools. git-svn-id: svn://svn.freebsd.org/base/stable/10@305106 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 5 +++++ cddl/contrib/opensolaris/tools/ctf/cvt/merge.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index 572540121..96beb7246 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -807,6 +807,11 @@ die_enum_create(dwarf_t *dw, Dwarf_Die die, Dwarf_Off off, tdesc_t *tdp) Dwarf_Unsigned uval; Dwarf_Signed sval; + if (die_isdecl(dw, die)) { + tdp->t_type = FORWARD; + return; + } + debug(3, "die %llu: creating enum\n", off); tdp->t_type = ENUM; diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c index 26b8d828e..d8bc2a975 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c @@ -348,7 +348,8 @@ fwd_equiv(tdesc_t *ctdp, tdesc_t *mtdp) { tdesc_t *defn = (ctdp->t_type == FORWARD ? mtdp : ctdp); - return (defn->t_type == STRUCT || defn->t_type == UNION); + return (defn->t_type == STRUCT || defn->t_type == UNION || + defn->t_type == ENUM); } static int -- 2.45.0