fprintf: Fix recursively printing named structs in --expand_types
Incf459ca16f
("fprintf: Pretty print struct members that are pointers to nameless structs") we end up breaking 'pahole --expand_types/-E. All we need there is to print nameless structs when they are referenced by a pointer member in a struct, i.e. it is defined only there, inline. Check if that struct is unnamed before emitting it, keeping that fix while fixing the regression it caused for --expand_types. Fixes:cf459ca16f
("fprintf: Pretty print struct members that are pointers to nameless structs") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
139a3b3373
commit
68f261d8df
|
@ -700,8 +700,8 @@ next_type:
|
|||
&tconf, fp);
|
||||
break;
|
||||
}
|
||||
if (tag__is_struct(ptype) || tag__is_union(ptype) ||
|
||||
tag__is_enumeration(ptype)) {
|
||||
if ((tag__is_struct(ptype) || tag__is_union(ptype) ||
|
||||
tag__is_enumeration(ptype)) && type__name(tag__type(ptype), cu) == NULL) {
|
||||
snprintf(namebfptr, sizeof(namebfptr), "* %s", name);
|
||||
tconf.rel_offset = 1;
|
||||
name = namebfptr;
|
||||
|
|
Loading…
Reference in New Issue