[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:
parent
de345d7d29
commit
aa961db9b9
13
dwarves.c
13
dwarves.c
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue