From 2b066ec1b8801b08052a68282ce34ef9c425ae8f Mon Sep 17 00:00:00 2001 From: fche Date: Sat, 21 May 2005 01:35:34 +0000 Subject: * at long last, a more full-bodied snapshot 2005-05-20 Frank Ch. Eigler Many changes throughout. Partial sketch of translation output. * elaborate.*: Elaboration pass. * translate.*: Translation pass. * staptree.*: Simplified for visitor concept. * main.cxx: Translator mainline. * *test.cxx: Removed. * testsuite/*: Some new tests, some changed for newer syntax. --- testsuite/semok/five.stp | 3 ++- testsuite/semok/four.stp | 2 +- testsuite/semok/one.stp | 2 +- testsuite/semok/seven.stp | 27 +++++++++++++++++++++++++++ testsuite/semok/six.stp | 4 +++- testsuite/semok/three.stp | 3 ++- testsuite/semok/two.stp | 2 +- 7 files changed, 37 insertions(+), 6 deletions(-) create mode 100755 testsuite/semok/seven.stp (limited to 'testsuite/semok') diff --git a/testsuite/semok/five.stp b/testsuite/semok/five.stp index 2bb656b1..4e229f42 100755 --- a/testsuite/semok/five.stp +++ b/testsuite/semok/five.stp @@ -1,5 +1,6 @@ -#! semtest +#! stap -p2 +global array probe foo { array[1] = array[2] = 3; diff --git a/testsuite/semok/four.stp b/testsuite/semok/four.stp index eb87f3f9..978ec557 100755 --- a/testsuite/semok/four.stp +++ b/testsuite/semok/four.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 # these will ultimately be somehow associated with "providers" # and have a syntax of their own diff --git a/testsuite/semok/one.stp b/testsuite/semok/one.stp index 764bd476..909d8eac 100755 --- a/testsuite/semok/one.stp +++ b/testsuite/semok/one.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 # these will ultimately be somehow associated with "providers" # and have a syntax of their own diff --git a/testsuite/semok/seven.stp b/testsuite/semok/seven.stp new file mode 100755 index 00000000..8351c1e2 --- /dev/null +++ b/testsuite/semok/seven.stp @@ -0,0 +1,27 @@ +#! stap -p2 + +global ar1, ar2 + +function string (v) { num=v+0; return "stringify me" } # to become a built-in +function printk (s) { str=s.""; return 0 } # to become a built-in + +function search (key) +{ + if (1) # (key in ar1) + { ar1[key] ++; return ar2[ar1[key]] } + else + return "no can do" # implies ar2[]: string +} + +probe syscall("zamboni") +{ + thread->ar2 = string ($tgid); + search ($pid) +} + +probe end +{ + # for (key in ar2) + if (1) # (key in ar2) + printk ("this: " . string (key) . " was " . ar2[key]) +} diff --git a/testsuite/semok/six.stp b/testsuite/semok/six.stp index 72b7e065..ef14827c 100755 --- a/testsuite/semok/six.stp +++ b/testsuite/semok/six.stp @@ -1,4 +1,6 @@ -#! semtest +#! stap -p2 + +global bar, baz probe foo { diff --git a/testsuite/semok/three.stp b/testsuite/semok/three.stp index 100a5f2b..41d726a0 100755 --- a/testsuite/semok/three.stp +++ b/testsuite/semok/three.stp @@ -1,5 +1,6 @@ -#! semtest +#! stap -p2 +global b probe foo { a <<< 2; b[4] <<< 4; diff --git a/testsuite/semok/two.stp b/testsuite/semok/two.stp index 5a124474..e68d596e 100755 --- a/testsuite/semok/two.stp +++ b/testsuite/semok/two.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 global bar, baz -- cgit