diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ctfconv/ctfconv.c | 4 | ||||
-rw-r--r-- | usr.bin/ctfconv/parse.c | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/usr.bin/ctfconv/ctfconv.c b/usr.bin/ctfconv/ctfconv.c index 7fa2a7dd9fe..c72503c1830 100644 --- a/usr.bin/ctfconv/ctfconv.c +++ b/usr.bin/ctfconv/ctfconv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctfconv.c,v 1.3 2017/08/11 16:28:29 mpi Exp $ */ +/* $OpenBSD: ctfconv.c,v 1.4 2017/08/11 16:55:46 mpi Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -383,7 +383,7 @@ dump_type(struct itype *it) TAILQ_FOREACH(im, &it->it_members, im_next) { printf("\t%s type=%u off=%zd\n", (im_name(im) == NULL) ? "unknown" : im_name(im), - im->im_refp->it_idx, im->im_off); + im->im_refp ? im->im_refp->it_idx : 0, im->im_off); } printf("\n"); break; diff --git a/usr.bin/ctfconv/parse.c b/usr.bin/ctfconv/parse.c index 5ce2f275105..e91616f7163 100644 --- a/usr.bin/ctfconv/parse.c +++ b/usr.bin/ctfconv/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.3 2017/08/11 16:28:30 mpi Exp $ */ +/* $OpenBSD: parse.c,v 1.4 2017/08/11 16:55:46 mpi Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -1011,6 +1011,16 @@ subparse_member(struct dwdie *die, size_t psz, struct itype *it, size_t offset) /* Skip members of members */ if (die->die_lvl > lvl + 1) continue; + /* + * Nested declaration. + * + * This matches the case where a ``struct'', ``union'', + * ``enum'' or ``typedef'' is first declared "inside" a + * union or struct declaration. + */ + if (tag == DW_TAG_structure_type || tag == DW_TAG_union_type || + tag == DW_TAG_enumeration_type || tag == DW_TAG_typedef) + continue; it->it_flags |= ITF_UNRES_MEMB; |