From d898100ab001dd4b3465f738dad76d1d646c3261 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 20 Nov 2007 03:59:19 +0000 Subject: PR 3887: sufficient+optional probe points 2007-11-19 Frank Ch. Eigler 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. --- staptree.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'staptree.cxx') 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 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; i0 ? ", " : ""); + if (i > 0) o << ", "; locations[i]->print (o); } } -- cgit