From 34201621cc07339371c8d74ce0fe609d967771d4 Mon Sep 17 00:00:00 2001 From: brolley Date: Wed, 27 Feb 2008 16:42:35 +0000 Subject: 2008-02-21 Dave Brolley 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. --- staptree.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'staptree.h') diff --git a/staptree.h b/staptree.h index 8235a535..acb56719 100644 --- a/staptree.h +++ b/staptree.h @@ -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(); } -- cgit