diff options
author | fche <fche> | 2005-08-24 17:01:52 +0000 |
---|---|---|
committer | fche <fche> | 2005-08-24 17:01:52 +0000 |
commit | bb788f9f3b8c22489a5dc5659a935e272b0e9b64 (patch) | |
tree | 969af38f4e6f3f9283f0dbf75967268df6d8c4fc /testsuite/buildok/sixteen.stp | |
parent | d072ec9d384f4f6072317e530b42a834f0982921 (diff) | |
download | systemtap-steved-bb788f9f3b8c22489a5dc5659a935e272b0e9b64.tar.gz systemtap-steved-bb788f9f3b8c22489a5dc5659a935e272b0e9b64.tar.xz systemtap-steved-bb788f9f3b8c22489a5dc5659a935e272b0e9b64.zip |
2005-08-24 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx (*::emit_probe_entries): Treat NULL and "" last_errors
both as clean early returns, not errors.
* translate.cxx: Revamp last_error handling logic. Remove all
"goto out" paths from expression context.
(visit_statement): Handle last_error exit one nesting level at a time.
(visit_return_statement, visit_functioncall): Set/reset last_error="".
(c_tmpcounter::visit_for_loop): New routine.
(c_unparser::visit_foreach, visit_for_loop): Rewrite to properly
support continue/breaks, non-local exits, (foreach) locks.
(emit_global): Emit lock variable.
(varlock ctor, dtor): Lock/unlock global variable.
(varlock_w, varlock_r): New concrete subclasses. Update all users.
* tapset/builtin_logging.stp (exit): Don't set last_error.
* src/testsuite/buildok/sixteen.stp: New test.
* tapsets.cxx: Temporarily rolled back graydon's changes.
Diffstat (limited to 'testsuite/buildok/sixteen.stp')
-rwxr-xr-x | testsuite/buildok/sixteen.stp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/buildok/sixteen.stp b/testsuite/buildok/sixteen.stp new file mode 100755 index 00000000..26932b8e --- /dev/null +++ b/testsuite/buildok/sixteen.stp @@ -0,0 +1,21 @@ +#! stap -p4 + +global a + +function foo () { + if (a[k] == "sayonara") { return 2 } +} + + +probe begin { + a[1] = "hello" + a[2] = "goodbye" + foreach (k in a) { + log (a[k]) + for (i=0; i<10; i++) { + log ("k=" . string(k) . " i=" . string(i)) + if (k % (i+1)) break else continue + } + if (k % 3) { foo() ; next } + } +} |