summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-08-05 22:58:46 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-08-05 23:08:44 -0400
commit9b988eff8c29377e658606a85f371ceb9acfef7d (patch)
tree8d77c25244a3c1c7f6b78063791b29af93d777d4 /testsuite
parent3d9889977397098d14c5be50f1dfef1c3eeb508f (diff)
downloadsystemtap-steved-9b988eff8c29377e658606a85f371ceb9acfef7d.tar.gz
systemtap-steved-9b988eff8c29377e658606a85f371ceb9acfef7d.tar.xz
systemtap-steved-9b988eff8c29377e658606a85f371ceb9acfef7d.zip
PR10294: support wider range for statement probe
* dwflpp.cxx (iterate_over_srcfile_lines): Add pattern parameter. * dwflpp.h (iterate_over_srcfile_lines): Ditto. * testsuite/systemtap.base/bz10294.c: Test case. * testsuite/systemtap.base/bz10294.stp: Ditto. * testsuite/systemtap.base/bz6905.exp: Deleted. * testsuite/systemtap.base/statement.exp: Merge bz10294 with bz6905.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/systemtap.base/bz10294.c21
-rw-r--r--testsuite/systemtap.base/bz10294.stp4
-rw-r--r--testsuite/systemtap.base/bz6905.exp24
-rw-r--r--testsuite/systemtap.base/statement.exp38
4 files changed, 63 insertions, 24 deletions
diff --git a/testsuite/systemtap.base/bz10294.c b/testsuite/systemtap.base/bz10294.c
new file mode 100644
index 00000000..1ea9a0d9
--- /dev/null
+++ b/testsuite/systemtap.base/bz10294.c
@@ -0,0 +1,21 @@
+int func_a(int a)
+{
+ a = a + 1;
+ return a;
+}
+
+
+int func_b(int b)
+{
+ b = b + 2;
+ return b;
+}
+
+int main()
+{
+ int a;
+
+ a = func_a(1);
+ a = a + func_b(a);
+ return 0;
+}
diff --git a/testsuite/systemtap.base/bz10294.stp b/testsuite/systemtap.base/bz10294.stp
new file mode 100644
index 00000000..0a18c45f
--- /dev/null
+++ b/testsuite/systemtap.base/bz10294.stp
@@ -0,0 +1,4 @@
+#! stap -p2
+probe process("./bz10294").statement("*@bz10294.c:10-10") {
+ printf("ok")
+}
diff --git a/testsuite/systemtap.base/bz6905.exp b/testsuite/systemtap.base/bz6905.exp
deleted file mode 100644
index 20a846cc..00000000
--- a/testsuite/systemtap.base/bz6905.exp
+++ /dev/null
@@ -1,24 +0,0 @@
-set test bz6905
-
-catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
-if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
-
-if {![utrace_p]} {
- catch {exec rm -f $test}
- untested "$test -p2"
- return
-}
-
-spawn stap -p2 $srcdir/$subdir/$test.stp
-set hint 0
-set probes 0
-expect {
- -timeout 60
- -re "# probes" { incr hint; exp_continue }
- -re {process.*statement.*} { incr probes; exp_continue }
- timeout { fail "$test (timeout)" }
- eof { }
-}
-wait
-if { $hint == 1 && $probes > 0 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" }
-exec rm -f $test
diff --git a/testsuite/systemtap.base/statement.exp b/testsuite/systemtap.base/statement.exp
new file mode 100644
index 00000000..d8fce8d8
--- /dev/null
+++ b/testsuite/systemtap.base/statement.exp
@@ -0,0 +1,38 @@
+set test bz6905
+
+catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
+if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
+
+spawn stap -p2 $srcdir/$subdir/$test.stp
+set hint 0
+set probes 0
+expect {
+ -timeout 60
+ -re "# probes" { incr hint; exp_continue }
+ -re {process.*statement.*} { incr probes; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+wait
+if { $hint == 1 && $probes > 0 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" }
+exec rm -f $test
+
+set test bz10294
+
+catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
+if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
+
+spawn stap -p2 $srcdir/$subdir/$test.stp
+set hint 0
+set probes 0
+expect {
+ -timeout 60
+ -re "# probes" { incr hint; exp_continue }
+ -re {process.*statement.*} { incr probes; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+wait
+if { $hint == 1 && $probes == 1 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" }
+exec rm -f $test
+