[LIB]: Reintroduce union__print, this time being called by tag__print

And will be used by a new dwarf, that is about to be merged.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-01-12 18:00:32 -02:00
parent de345d7d29
commit aa961db9b9
1 changed files with 13 additions and 0 deletions

View File

@ -1190,6 +1190,16 @@ static size_t union__snprintf(const struct type *self, const struct cu *cu,
return len - l;
}
static void union__print(const struct tag *tag, const struct cu *cu,
const char *suffix)
{
const struct type *utype = tag__type(tag);
char bf[32768];
union__snprintf(utype, cu, bf, sizeof(bf), suffix, 0, 26, 23);
fputs(bf, stdout);
}
static struct class *class__new(Dwarf_Die *die)
{
struct class *self = zalloc(sizeof(*self));
@ -1952,6 +1962,9 @@ void tag__print(const struct tag *self, const struct cu *cu,
case DW_TAG_subprogram:
function__print(self, cu);
break;
case DW_TAG_union_type:
union__print(self, cu, suffix);
break;
default:
printf("%s: %s tag not supported!\n", __FUNCTION__,
dwarf_tag_name(self->tag));