diff options
author | Elliott Baron <ebaron@toriamos.yyz.redhat.com> | 2008-10-20 11:11:19 -0400 |
---|---|---|
committer | Elliott Baron <ebaron@toriamos.yyz.redhat.com> | 2008-10-20 11:11:19 -0400 |
commit | fecccf83624c2f09207cd281f9efc272300e8e55 (patch) | |
tree | d5509bcee4798d90781cb6c1f7dc8741a32bc28a | |
parent | 6b1730cb635b8d671bca8c3df173db3f1282ecdb (diff) | |
download | systemtap-steved-fecccf83624c2f09207cd281f9efc272300e8e55.tar.gz systemtap-steved-fecccf83624c2f09207cd281f9efc272300e8e55.tar.xz systemtap-steved-fecccf83624c2f09207cd281f9efc272300e8e55.zip |
PR6851: Added support for %c printf conversion specifier [trying again]
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | elaborate.cxx | 7 | ||||
-rw-r--r-- | staptree.cxx | 10 | ||||
-rw-r--r-- | staptree.h | 1 | ||||
-rw-r--r-- | testsuite/ChangeLog | 5 |
5 files changed, 29 insertions, 4 deletions
@@ -1,3 +1,13 @@ +2008-10-20 Elliott Baron <ebaron@redhat.com> + + PR6851 + * elaborate.cxx (typeresolution_info::visit_print_format): add case + for conv_char. + * staptree.cxx (print_format::components_to_string): add case for + conv_char. + (print_format::string_to_components): add parsing for "c" conversion. + * staptree.h (enum conversion_type): add conv_char member. + 2008-10-17 Frank Ch. Eigler <fche@elastic.org> * stap-report: Add kernel config extracts. Generate to stdout. diff --git a/elaborate.cxx b/elaborate.cxx index 9f0a2a74..e4251f2a 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1439,17 +1439,17 @@ systemtap_session::print_error (const semantic_error& e) for (int i=0; i<2; i++) { stringstream message; - + message << "semantic error: " << e.what (); if (e.tok1 || e.tok2) message << ": "; - if (e.tok1) + if (e.tok1) { if (i == 0) print_token (message, e.tok1); else message << *e.tok1; } message << e.msg2; - if (e.tok2) + if (e.tok2) { if (i == 0) print_token (message, e.tok2); else message << *e.tok2; @@ -3903,6 +3903,7 @@ typeresolution_info::visit_print_format (print_format* e) case print_format::conv_unsigned_uppercase_hex: case print_format::conv_unsigned_lowercase_hex: case print_format::conv_binary: + case print_format::conv_char: case print_format::conv_memory: wanted = pe_long; break; diff --git a/staptree.cxx b/staptree.cxx index 73d6fe93..38166c54 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -458,6 +458,10 @@ print_format::components_to_string(vector<format_component> const & components) oss << "b"; break; + case conv_char: + oss << "llc"; + break; + case conv_signed_decimal: oss << "lld"; break; @@ -635,7 +639,7 @@ print_format::string_to_components(string const & str) if (i == str.end()) break; - // Parse the actual conversion specifier (sdiouxX) + // Parse the actual conversion specifier (bcsmdioupxXn) switch (*i) { // Valid conversion types @@ -643,6 +647,10 @@ print_format::string_to_components(string const & str) curr.type = conv_binary; break; + case 'c': + curr.type = conv_char; + break; + case 's': curr.type = conv_string; break; @@ -287,6 +287,7 @@ struct print_format: public expression conv_unsigned_uppercase_hex, conv_unsigned_lowercase_hex, conv_string, + conv_char, conv_memory, conv_literal, conv_binary, diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 1664f8c2..2ec0fb0e 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-10-20 Elliott Baron <ebaron@redhat.com> + + PR6851 + * systemtap.printf/char1.exp: New test. + 2008-10-10 Frank Ch. Eigler <fche@elastic.org> PR6749. |