diff options
author | Mark Johnston <markj@FreeBSD.org> | 2016-08-13 19:51:00 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2016-08-13 19:51:00 +0000 |
commit | eb9da1ada8b6b2c74378a5c17029ec5a7fb199e6 (patch) | |
tree | 5e60f4e861f52d6b87d86a6cdc7de28bf8a9bf51 | |
parent | 842ee21e20f08fb63fbc0a8b4c51aedf32658680 (diff) | |
download | src-eb9da1ada8b6b2c74378a5c17029ec5a7fb199e6.tar.gz src-eb9da1ada8b6b2c74378a5c17029ec5a7fb199e6.zip |
Fix handling of forward enum declarations in the CTF tools.
Reported by: mmacy
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=304055
-rw-r--r-- | cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 5 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/tools/ctf/cvt/merge.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index e439f04616af..cfcf627ab1af 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -816,6 +816,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 5b22a31140d7..3dc2ad0cbdad 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c @@ -338,7 +338,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 |