From 32784362de8e2cfc686ce98557dd261003aff2ff Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 12 Nov 2007 21:55:53 +0000 Subject: 2007-11-12 Martin Hunt * translate.cxx (visit_print_format): Strings without a format or formatted with "%s" or "%s\n" should be printed with calls to _stp_print(). Call _stp_print_char() if printing a char. * staptree.cxx (parse_print): Check for "print_char". * staptree.h (struct print_format): Add print_char. (parse_print): Update prototype. * parse.cxx (parse_symbol): Set print_char bool in print_format. --- staptree.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'staptree.cxx') diff --git a/staptree.cxx b/staptree.cxx index ccfc8a8d..d71472a6 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -340,12 +340,18 @@ void functioncall::print (ostream& o) const bool print_format::parse_print(const std::string &name, - bool &stream, bool &format, bool &delim, bool &newline) + bool &stream, bool &format, bool &delim, bool &newline, bool &_char) { const char *n = name.c_str(); stream = true; - format = delim = newline = false; + format = delim = newline = _char = false; + + if (strcmp(n, "print_char") == 0) + { + _char = true; + return true; + } if (*n == 's') { @@ -2292,6 +2298,7 @@ deep_copy_visitor::visit_print_format (print_format* e) n->print_with_format = e->print_with_format; n->print_with_delim = e->print_with_delim; n->print_with_newline = e->print_with_newline; + n->print_char = e->print_char; n->raw_components = e->raw_components; n->components = e->components; n->delimiter = e->delimiter; -- cgit