diff options
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r-- | tools/perf/util/probe-finder.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 32b81f707ff..a2d1f790d93 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -160,26 +160,35 @@ static bool die_compare_name(Dwarf_Die *dw_die, const char *tname) | |||
160 | return name ? (strcmp(tname, name) == 0) : false; | 160 | return name ? (strcmp(tname, name) == 0) : false; |
161 | } | 161 | } |
162 | 162 | ||
163 | /* Get type die */ | ||
164 | static Dwarf_Die *die_get_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem) | ||
165 | { | ||
166 | Dwarf_Attribute attr; | ||
167 | |||
168 | if (dwarf_attr_integrate(vr_die, DW_AT_type, &attr) && | ||
169 | dwarf_formref_die(&attr, die_mem)) | ||
170 | return die_mem; | ||
171 | else | ||
172 | return NULL; | ||
173 | } | ||
174 | |||
163 | /* Get type die, but skip qualifiers and typedef */ | 175 | /* Get type die, but skip qualifiers and typedef */ |
164 | static Dwarf_Die *die_get_real_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem) | 176 | static Dwarf_Die *die_get_real_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem) |
165 | { | 177 | { |
166 | Dwarf_Attribute attr; | ||
167 | int tag; | 178 | int tag; |
168 | 179 | ||
169 | do { | 180 | do { |
170 | if (dwarf_attr(vr_die, DW_AT_type, &attr) == NULL || | 181 | vr_die = die_get_type(vr_die, die_mem); |
171 | dwarf_formref_die(&attr, die_mem) == NULL) | 182 | if (!vr_die) |
172 | return NULL; | 183 | break; |
173 | 184 | tag = dwarf_tag(vr_die); | |
174 | tag = dwarf_tag(die_mem); | ||
175 | vr_die = die_mem; | ||
176 | } while (tag == DW_TAG_const_type || | 185 | } while (tag == DW_TAG_const_type || |
177 | tag == DW_TAG_restrict_type || | 186 | tag == DW_TAG_restrict_type || |
178 | tag == DW_TAG_volatile_type || | 187 | tag == DW_TAG_volatile_type || |
179 | tag == DW_TAG_shared_type || | 188 | tag == DW_TAG_shared_type || |
180 | tag == DW_TAG_typedef); | 189 | tag == DW_TAG_typedef); |
181 | 190 | ||
182 | return die_mem; | 191 | return vr_die; |
183 | } | 192 | } |
184 | 193 | ||
185 | static bool die_is_signed_type(Dwarf_Die *tp_die) | 194 | static bool die_is_signed_type(Dwarf_Die *tp_die) |