summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorfche <fche>2007-11-20 03:59:19 +0000
committerfche <fche>2007-11-20 03:59:19 +0000
commitd898100ab001dd4b3465f738dad76d1d646c3261 (patch)
treeeb20e3219db643c07802dbec890b704e44b87458 /staptree.cxx
parent3b0c565c2b75d777c3993f0284185b5aa4c3528d (diff)
downloadsystemtap-steved-d898100ab001dd4b3465f738dad76d1d646c3261.tar.gz
systemtap-steved-d898100ab001dd4b3465f738dad76d1d646c3261.tar.xz
systemtap-steved-d898100ab001dd4b3465f738dad76d1d646c3261.zip
PR 3887: sufficient+optional probe points
2007-11-19 Frank Ch. Eigler <fche@elastic.org> PR 3887. * staptree.h (probe_point): Add "sufficient" field. * staptree.cxx: Initialize it, print it. * parse.cxx (parse_probe_point): Parse it. * elaborate.cxx (derive_probes): Implement it. * stapprobes.5.in: Document it. * NEWS: Gloat about it. * parseok/five.stp, semok/twentyseven.stp: Test "!" probe point flag. * iostat-scsi.stp: Adopt "!" probe point flag.
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/staptree.cxx b/staptree.cxx
index d71472a6..8b702306 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -75,12 +75,12 @@ symboldecl::~symboldecl ()
probe_point::probe_point (std::vector<component*> const & comps,
const token * t):
- components(comps), tok(t), optional (false)
+ components(comps), tok(t), optional (false), sufficient (false)
{
}
probe_point::probe_point ():
- tok (0), optional (false)
+ tok (0), optional (false), sufficient (false)
{
}
@@ -530,7 +530,7 @@ print_format::string_to_components(string const & str)
break;
// Now we are definitely parsing a conversion.
- // Begin by parsing flags (whicih are optional).
+ // Begin by parsing flags (which are optional).
switch (*i)
{
@@ -908,7 +908,9 @@ void probe_point::print (ostream& o) const
if (c->arg)
o << "(" << *c->arg << ")";
}
- if (optional)
+ if (sufficient)
+ o << "!";
+ else if (optional) // sufficient implies optional
o << "?";
}
@@ -923,7 +925,9 @@ string probe_point::str ()
if (c->arg)
o << "(" << *c->arg << ")";
}
- if (optional)
+ if (sufficient)
+ o << "!";
+ else if (optional) // sufficient implies optional
o << "?";
return o.str();
}
@@ -944,7 +948,7 @@ void probe_alias::printsig (ostream& o) const
o << " = ";
for (unsigned i=0; i<locations.size(); i++)
{
- o << (i>0 ? ", " : "");
+ if (i > 0) o << ", ";
locations[i]->print (o);
}
}