summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in2
-rw-r--r--loc2c.c13
-rwxr-xr-xtestsuite/semok/bz10475.stp10
4 files changed, 25 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 37491eef..c2234d1c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = no-dist foreign
pkglibexecdir = ${libexecdir}/${PACKAGE}
oldincludedir = ${includedir}/sys
-AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"'
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"' -I$(srcdir)/includes
AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W
AM_CXXFLAGS = -Wall -Werror
diff --git a/Makefile.in b/Makefile.in
index 9410eaae..a1b45add 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -358,7 +358,7 @@ top_srcdir = @top_srcdir@
# we don't maintain a ChangeLog, which makes us non-GNU -> foreign
AUTOMAKE_OPTIONS = no-dist foreign
-AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"'
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"' -I$(srcdir)/includes
AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W
AM_CXXFLAGS = -Wall -Werror
man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap \
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;
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])
+}