]> sourceware.org Git - systemtap.git/commitdiff
Avoid assertion error for no matched function in statement probe
authorWenji Huang <wenji.huang@oracle.com>
Mon, 10 Aug 2009 23:29:50 +0000 (19:29 -0400)
committerWenji Huang <wenji.huang@oracle.com>
Mon, 10 Aug 2009 23:29:50 +0000 (19:29 -0400)
* dwflpp.cxx (iterate_over_functions): Return for NULL pointer.
* testsuite/systemtap.base/statement.exp: Add test case.

dwflpp.cxx
testsuite/systemtap.base/statement.exp

index c31fbe4e886954e4f9402a64081819f0b8a6f642..d02698b2a311189102602c73688944495c113b85 100644 (file)
@@ -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)
     {
index d8fce8d8a4758e5f9f61658de6851c60cc2d65a9..8d4c59f5b1c61c523db4339f4aa9b0b8b6073643 100644 (file)
@@ -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
 
This page took 0.034431 seconds and 5 git commands to generate.