diff options
-rw-r--r-- | loc2c.c | 13 | ||||
-rwxr-xr-x | testsuite/semok/bz10475.stp | 10 |
2 files changed, 23 insertions, 0 deletions
@@ -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; diff --git a/testsuite/semok/bz10475.stp b/testsuite/semok/bz10475.stp new file mode 100755 index 00000000..ee79b07d --- /dev/null +++ b/testsuite/semok/bz10475.stp @@ -0,0 +1,10 @@ +#! stap -p2 +// bz10475: pointer-array confused about array element size + +// struct file *do_filp_open(int dfd, const char *pathname, +// int open_flag, int mode, int acc_mode) +probe kernel.function("do_filp_open") +{ + // check array access on a "complex" pointer type + println($pathname[0]) +} |