diff options
-rw-r--r-- | dwflpp.cxx | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/statement.exp | 12 |
2 files changed, 14 insertions, 0 deletions
@@ -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 |