diff options
author | brolley <brolley> | 2008-02-27 16:42:35 +0000 |
---|---|---|
committer | brolley <brolley> | 2008-02-27 16:42:35 +0000 |
commit | 34201621cc07339371c8d74ce0fe609d967771d4 (patch) | |
tree | f2122e04569f569d2ff848435af6c2f343a2ac63 /staptree.h | |
parent | 67bae0e3d979d554acaeb2a09cf4f7463ee713da (diff) | |
download | systemtap-steved-34201621cc07339371c8d74ce0fe609d967771d4.tar.gz systemtap-steved-34201621cc07339371c8d74ce0fe609d967771d4.tar.xz systemtap-steved-34201621cc07339371c8d74ce0fe609d967771d4.zip |
2008-02-21 Dave Brolley <brolley@redhat.com>
PR5189
* staptree.h (print_format::conv_memory): New enumerator.
(print_format::width_type): New enumeration.
(print_format::precision_type): New enumeration.
(format_component::widthtype): New member.
(format_component::prectype): New member.
(format_component::is_empty): Test widthtype and prectype.
(format_component::clear): Clear widthtype and prectype.
* staptree.cxx (print_format::components_to_string): Handle dynamic width and precision.
Handle conv_memory.
(print_format::string_to_components): Parse dynamic width and precision specifiers.
Set widthtype and prectype. Parse %m format specifier.
* elaborate.h (typeresolution_info::check_arg_type): New method.
* elaborate.cxx (typeresolution_info::visit_print_format): Account for dynamic width
and precision when computing the expected number of arguments. Check the types of
arguments for dynamic width and precision. Use check_arg_type to check the types of
all arguments. Handle print_format::conv_memory.
(typeresolution_info::check_arg_type): New method.
* NEWS: Describe the enhancements above.
Diffstat (limited to 'staptree.h')
-rw-r--r-- | staptree.h | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -287,31 +287,48 @@ struct print_format: public expression conv_unsigned_uppercase_hex, conv_unsigned_lowercase_hex, conv_string, + conv_memory, conv_literal, conv_binary, conv_size }; + enum width_type + { + width_unspecified, + width_static, + width_dynamic + }; + + enum precision_type + { + prec_unspecified, + prec_static, + prec_dynamic + }; + struct format_component { unsigned long flags; unsigned width; unsigned precision; + width_type widthtype; + precision_type prectype; conversion_type type; std::string literal_string; bool is_empty() const { return flags == 0 - && width == 0 - && precision == 0 + && widthtype == width_unspecified + && prectype == prec_unspecified && type == conv_unspecified && literal_string.empty(); } void clear() { flags = 0; - width = 0; - precision = 0; + widthtype = width_unspecified; + prectype = prec_unspecified; type = conv_unspecified; literal_string.clear(); } |