summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-02-27 12:54:34 -0500
committerFrank Ch. Eigler <fche@elastic.org>2008-02-27 12:54:34 -0500
commited1f47c32969a60eb074dc246c79ccda456ebf58 (patch)
tree65f8bc63b516fe525af1409fad83f44235d9e675 /staptree.cxx
parent781c25855e35a7b77e5794bd027ca0cf41e4a3a4 (diff)
parenta2dc47ddef0dbed1b0dc912c876f5f57f97c1ede (diff)
downloadsystemtap-steved-ed1f47c32969a60eb074dc246c79ccda456ebf58.tar.gz
systemtap-steved-ed1f47c32969a60eb074dc246c79ccda456ebf58.tar.xz
systemtap-steved-ed1f47c32969a60eb074dc246c79ccda456ebf58.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx54
1 files changed, 45 insertions, 9 deletions
diff --git a/staptree.cxx b/staptree.cxx
index 36ef04f5..63c1fcf7 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -442,10 +442,14 @@ print_format::components_to_string(vector<format_component> const & components)
if (i->flags & static_cast<unsigned long>(fmt_flag_special))
oss << '#';
- if (i->width > 0)
+ if (i->widthtype == width_dynamic)
+ oss << '*';
+ else if (i->widthtype != width_unspecified && i->width > 0)
oss << i->width;
- if (i->precision > 0)
+ if (i->prectype == prec_dynamic)
+ oss << ".*";
+ else if (i->prectype != prec_unspecified && i->precision > 0)
oss << '.' << i->precision;
switch (i->type)
@@ -482,6 +486,10 @@ print_format::components_to_string(vector<format_component> const & components)
oss << 's';
break;
+ case conv_memory:
+ oss << 'm';
+ break;
+
case conv_size:
oss << 'n';
break;
@@ -574,14 +582,27 @@ print_format::string_to_components(string const & str)
break;
}
+ if (i == str.end())
+ break;
+
// Parse optional width
-
- while (i != str.end() && isdigit(*i))
+ if (*i == '*')
{
- curr.width *= 10;
- curr.width += (*i - '0');
+ curr.widthtype = width_dynamic;
++i;
}
+ else if (isdigit(*i))
+ {
+ curr.widthtype = width_static;
+ curr.width = 0;
+ do
+ {
+ curr.width *= 10;
+ curr.width += (*i - '0');
+ ++i;
+ }
+ while (i != str.end() && isdigit(*i));
+ }
if (i == str.end())
break;
@@ -592,12 +613,23 @@ print_format::string_to_components(string const & str)
++i;
if (i == str.end())
break;
- while (i != str.end() && isdigit(*i))
+ if (*i == '*')
{
- curr.precision *= 10;
- curr.precision += (*i - '0');
+ curr.prectype = prec_dynamic;
++i;
}
+ else if (isdigit(*i))
+ {
+ curr.prectype = prec_static;
+ curr.precision = 0;
+ do
+ {
+ curr.precision *= 10;
+ curr.precision += (*i - '0');
+ ++i;
+ }
+ while (i != str.end() && isdigit(*i));
+ }
}
if (i == str.end())
@@ -615,6 +647,10 @@ print_format::string_to_components(string const & str)
curr.type = conv_string;
break;
+ case 'm':
+ curr.type = conv_memory;
+ break;
+
case 'd':
case 'i':
curr.type = conv_signed_decimal;