summaryrefslogtreecommitdiffstats
path: root/stap.1.in
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2010-03-03 00:28:22 -0500
committerFrank Ch. Eigler <fche@elastic.org>2010-03-03 00:33:43 -0500
commitf4fe2e932cc8f445e9e1bc52863e11b669e3afc9 (patch)
treeba062952c0a37f02ebcf0eb2f533d44ee41fdb25 /stap.1.in
parentd105f6642677bd9ef1b20d1ba180ba0163cb0fa6 (diff)
downloadsystemtap-steved-f4fe2e932cc8f445e9e1bc52863e11b669e3afc9.tar.gz
systemtap-steved-f4fe2e932cc8f445e9e1bc52863e11b669e3afc9.tar.xz
systemtap-steved-f4fe2e932cc8f445e9e1bc52863e11b669e3afc9.zip
PR11004: try / catch error-handling script syntax
* parse.h (try_block): New class. Update basic visitors. * staptree.cxx: Implement basic visitors. * parse.cxx (expect_kw): Fix to actually look for keywords. (parse_try_block): New function. (lexer ctor): Designate 'try' and 'catch' as keywords. * elaborate.cxx (dead_assignment_remover, dead_statmtexpr_remover): Optimize. (other visitors): Implement. * translate.cxx (c_unparser): Implement via super-handy __local__ labels. (emit_probe, emit_function): Make outer out: label also __local__. * testsuite/buildok/fortyone.stp, semko/fortynine.stp, systemtap.base/trycatch.exp: Test it. * NEWS, doc/langref.txt, stap.1.in: Document it.
Diffstat (limited to 'stap.1.in')
-rw-r--r--stap.1.in11
1 files changed, 10 insertions, 1 deletions
diff --git a/stap.1.in b/stap.1.in
index 6ef39ba5..531b0f88 100644
--- a/stap.1.in
+++ b/stap.1.in
@@ -493,7 +493,16 @@ not taken anywhere, then a return statement is not needed, and the
function will have a special "unknown" type with no return value.
.TP
.BR next
-Return now from enclosing probe handler.
+Return now from enclosing probe handler. This is especially useful in
+probe aliases that apply event filtering predicates.
+.TP
+.BR try " { STMT1 } " catch " { STMT2 }"
+Run the statements in the first block. Upon any run-time errors, abort
+STMT1 and start executing STMT2. Any errors in STMT2 will propagate to
+outer try/catch blocks, if any.
+.TP
+.BR try " { STMT1 } " catch "(VAR) { STMT2 }"
+Same as above, plus assign the error message to the string scalar variable VAR.
.TP
.BR delete " ARRAY[INDEX1, INDEX2, ...]"
Remove from ARRAY the element specified by the index tuple. The value will no