diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-02-16 19:06:00 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-02-16 19:06:54 -0300 |
commit | 0064b74c5ef0f358e52620070838e90154506a4d (patch) | |
tree | 587453674c5c51d484006f768d6a4f6815601a72 | |
parent | 1fd08c0f0021e7fbaa31b1add7667b147edd5a9c (diff) | |
download | pahole-0064b74c5ef0f358e52620070838e90154506a4d.tar.gz |
fprintf: When expanding types do it for enums as well
For instance, 'pahole -E module' in the Linux kernel will have this
diff:
struct module {
- enum module_state state; /* 0 4 */
+ enum module_state {
+ MODULE_STATE_LIVE = 0,
+ MODULE_STATE_COMING = 1,
+ MODULE_STATE_GOING = 2,
+ MODULE_STATE_UNFORMED = 3,
+ } state; /* 0 4 */
/* XXX 4 bytes hole, try to pack */
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | dwarves_fprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c index 9e5e6631..b6f8ed17 100644 --- a/dwarves_fprintf.c +++ b/dwarves_fprintf.c @@ -901,7 +901,7 @@ print_modifier: { case DW_TAG_enumeration_type: ctype = tag__type(type); - if (type__name(ctype) != NULL) + if (type__name(ctype) != NULL && !expand_types) printed += fprintf(fp, "enum %-*s %s", tconf.type_spacing - 5, type__name(ctype), name ?: ""); else printed += enumeration__fprintf(type, &tconf, fp); |