diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-13 15:30:19 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-13 15:30:19 -0300 |
commit | 7d0bc9334d2f1143a8682b141eda79f8be1bd5d2 (patch) | |
tree | 39ceb855aafd0c2ef8e09da1e203152cf254456d | |
parent | 8894c04f00e4c702ad7c36b69c4808e1908033f9 (diff) | |
download | pahole-7d0bc9334d2f1143a8682b141eda79f8be1bd5d2.tar.gz |
fprintf: Support _Atomic typedefs
Now this works:
<1><1cf46e>: Abbrev Number: 91 (DW_TAG_base_type)
<1cf46f> DW_AT_byte_size : 1
<1cf470> DW_AT_encoding : 2 (boolean)
<1cf471> DW_AT_name : (indirect string, offset: 0x91ef): _Bool
<1><1d1a3c>: Abbrev Number: 71 (DW_TAG_structure_type)
<1d1a3d> DW_AT_byte_size : 1
<1d1a3e> DW_AT_decl_file : 87
<1d1a3f> DW_AT_decl_line : 218
<1d1a40> DW_AT_decl_column : 17
<1d1a41> DW_AT_sibling : <0x1d1a53>
<2><1d1a45>: Abbrev Number: 7 (DW_TAG_member)
<1d1a46> DW_AT_name : (indirect string, offset: 0xfb0): __val
<1d1a4a> DW_AT_decl_file : 87
<1d1a4b> DW_AT_decl_line : 221
<1d1a4c> DW_AT_decl_column : 9
<1d1a4d> DW_AT_type : <0x1cf46e>
<1d1a51> DW_AT_data_member_location: 0
<2><1d1a52>: Abbrev Number: 0
<1><1d1a53>: Abbrev Number: 66 (DW_TAG_atomic_type)
<1d1a54> DW_AT_type : <0x1d1a3c>
<1><1d1a58>: Abbrev Number: 51 (DW_TAG_typedef)
<1d1a59> DW_AT_name : (indirect string, offset: 0x363b3): atomic_flag
<1d1a5d> DW_AT_decl_file : 87
<1d1a5e> DW_AT_decl_line : 225
<1d1a5f> DW_AT_decl_column : 3
<1d1a60> DW_AT_type : <0x1d1a53>
⬢[acme@toolbox pahole]$ grep -A5 'typedef _Atomic struct {' ovs-vswitchd_f35.c
typedef _Atomic struct {
_Bool __val; /* 0 1 */
/* size: 1, cachelines: 1, members: 1 */
/* last cacheline: 1 bytes */
} atomic_flag;
⬢[acme@toolbox pahole]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | dwarves_fprintf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c index a755ef28..e62bce1e 100644 --- a/dwarves_fprintf.c +++ b/dwarves_fprintf.c @@ -311,7 +311,7 @@ size_t typedef__fprintf(const struct tag *tag, const struct cu *cu, */ if (tag->type == 0) return printed + fprintf(fp, "void %s", type__name(type)); - +next_type: tag_type = cu__type(cu, tag->type); if (tag_type == NULL) { printed += tag__id_not_found_fprintf(fp, tag->type); @@ -319,6 +319,10 @@ size_t typedef__fprintf(const struct tag *tag, const struct cu *cu, } switch (tag_type->tag) { + case DW_TAG_atomic_type: + printed += fprintf(fp, "_Atomic "); + tag = tag_type; + goto next_type; case DW_TAG_array_type: return printed + array_type__fprintf(tag_type, cu, type__name(type), pconf, fp); case DW_TAG_pointer_type: |