From 3cb170588c9b180fb4d28af04e44ac87481560a7 Mon Sep 17 00:00:00 2001 From: jistone Date: Fri, 17 Aug 2007 01:54:28 +0000 Subject: 2007-08-16 Josh Stone PR 4591 * parse.cxx (parser::parse_symbol): Tweak 'print' matching to allow all the new variants with printd and println. * staptree.h (struct print_format): Add fields for the new print variants, and parse_print() to help matching. * staptree.cxx (print_format::parse_print): New static method to match the print variants and determine their properties. (print_format::print): Handle the new print types. (deep_copy_visitor::visit_print_format): Copy the new fields. * translate.cxx (c_unparser::visit_print_format): Insert delims and newlines where appropriate for new print functions. * stap1.in: Document the new print functions. testsuite/ * lib/stap_run.exp: Make sure to match the entire output, in case there are multiple pass/fail messages. * buildok/printf.stp: Add lines for new print variants. * parseko/printd01.stp: Make sure that bad printd calls are handled. * parseko/printd02.stp: Ditto. * parseko/printd03.stp: Ditto. * parseko/printd04.stp: Ditto. * systemtap.base/print.stp: Try a bunch of different print calls. * systemtap.base/print.exp: Driver for above. --- staptree.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'staptree.h') diff --git a/staptree.h b/staptree.h index 415d510b..a6b7c173 100644 --- a/staptree.h +++ b/staptree.h @@ -262,8 +262,10 @@ struct functioncall: public expression struct print_format: public expression { - bool print_with_format; bool print_to_stream; + bool print_with_format; + bool print_with_delim; + bool print_with_newline; enum format_flag { @@ -320,11 +322,14 @@ struct print_format: public expression std::string raw_components; std::vector components; + format_component delimiter; std::vector args; hist_op *hist; static std::string components_to_string(std::vector const & components); static std::vector string_to_components(std::string const & str); + static bool parse_print(const std::string &name, + bool &stream, bool &format, bool &delim, bool &newline); void print (std::ostream& o) const; void visit (visitor* u); -- cgit