summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwflpp.cxx2
-rw-r--r--testsuite/systemtap.base/statement.exp12
2 files changed, 14 insertions, 0 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index c31fbe4e..d02698b2 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -791,6 +791,8 @@ dwflpp::iterate_over_srcfile_lines (char const * srcfile,
auto_free_ref<Dwarf_Line**> free_srcsp(srcsp);
get_module_dwarf();
+ if (!this->function)
+ return;
if (line_type == RELATIVE)
{
diff --git a/testsuite/systemtap.base/statement.exp b/testsuite/systemtap.base/statement.exp
index d8fce8d8..8d4c59f5 100644
--- a/testsuite/systemtap.base/statement.exp
+++ b/testsuite/systemtap.base/statement.exp
@@ -34,5 +34,17 @@ expect {
}
wait
if { $hint == 1 && $probes == 1 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" }
+
+set no_func stmtnofunc
+set func_script "probe process(\"%s\").statement(\"foo@%s.c:*\"){}"
+set script [format $func_script "./$test" "$test"]
+spawn stap -p2 -e $script
+expect {
+ -timeout 60
+ -re {semantic error: no match while resolving probe point.*\r\n} { xfail $no_func }
+ timeout { fail "$no_func (timeout)" }
+ eof { fail $no_func }
+}
+wait
exec rm -f $test