summaryrefslogtreecommitdiffstats
path: root/loc2c.c
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-08-03 14:20:46 -0700
committerJosh Stone <jistone@redhat.com>2009-08-03 14:20:46 -0700
commit28ad563d57d03e0d21936e394061e3380607d83b (patch)
tree2142018c159bd8b1b99d2ef08129d7db5228c477 /loc2c.c
parent79a7b65cf99ca7ec258d11c41af5d8ab13abf609 (diff)
downloadsystemtap-steved-28ad563d57d03e0d21936e394061e3380607d83b.tar.gz
systemtap-steved-28ad563d57d03e0d21936e394061e3380607d83b.tar.xz
systemtap-steved-28ad563d57d03e0d21936e394061e3380607d83b.zip
PR10475: ensure that loc2c can find its array size
* loc2c.c (array_stride): iterate DIEs past typedef/const/volatile
Diffstat (limited to 'loc2c.c')
-rw-r--r--loc2c.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/loc2c.c b/loc2c.c
index f5efccfe..26ca3ba1 100644
--- a/loc2c.c
+++ b/loc2c.c
@@ -1749,6 +1749,19 @@ array_stride (Dwarf_Die *typedie, struct location *origin)
dwarf_diename (typedie) ?: "<anonymous>",
dwarf_errmsg (-1));
+ int typetag = dwarf_tag(&die_mem);
+ while (typetag == DW_TAG_typedef ||
+ typetag == DW_TAG_const_type ||
+ typetag == DW_TAG_volatile_type)
+ {
+ if (dwarf_attr_integrate (&die_mem, DW_AT_type, &attr_mem) == NULL
+ || dwarf_formref_die (&attr_mem, &die_mem) == NULL)
+ FAIL (origin, N_("cannot get inner type of type %s: %s"),
+ dwarf_diename (&die_mem) ?: "<anonymous>",
+ dwarf_errmsg (-1));
+ typetag = dwarf_tag(&die_mem);
+ }
+
if (dwarf_attr_integrate (&die_mem, DW_AT_byte_size, &attr_mem) != NULL)
{
Dwarf_Word stride;