From f4fe2e932cc8f445e9e1bc52863e11b669e3afc9 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 3 Mar 2010 00:28:22 -0500 Subject: 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. --- NEWS | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index d9f70676..8e33631d 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,11 @@ * What's new +- A new construct for error handling is available. It is similar to c++ + exception catching, using try and catch as new keywords. Within a handler + or function, the following is valid and may be nested: + try { /* arbitrary statements */ } + catch (er) { /* e.g. println("caught error ", er) */ } + - A new command line flag '-W' forces systemtap to abort translation of a script if any warnings are produced. It is similar to gcc's -Werror. (If '-w' is also supplied to suppress warnings, it wins.) -- cgit