From cbbe8080060563441ba79ed4645e9b533a870409 Mon Sep 17 00:00:00 2001 From: hiramatu Date: Tue, 20 Nov 2007 21:03:16 +0000 Subject: 2007-11-20 Masami Hiramatsu PR 4935. * parse.cxx (parser::parse_probe_point): Parse "if" condition following probe point. * staptree.h (probe_point): Add "condition" field. (probe): Add "condition" field and "add_condition" method. (deep_copy_visitor): Add "deep_copy" method for the expression. * staptree.cxx (probe_point::probe_point): Initalize it. (probe::add_condition): Implement it. (probe::print): Output "condition" field. (probe::str): Ditto. (deep_copy_visitor::deep_copy): Implement it. * elaborate.h (derived_probe): Add "insert_condition_statement" method. * elaborate.cxx (derived_probe::derived_probe): Initialize "condition" field, and insert a condition check routine on the top of body. (derived_probe::insert_condition_statement): Implement it. (alias_expansion_builder::build): Pass the condition from the alias referer to new alias. * tapsets.cxx (be_derived_probe): Remove unused constructor. (dwarf_derived_probe::dwarf_derived_probe): Insert a condition check routine on the top of body. (mark_derived_probe::mark_derived_probe): Ditto. (mark_builder::build): Pass the base location to mark_derived_probe. --- staptree.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'staptree.h') diff --git a/staptree.h b/staptree.h index d8c97633..9e32d16b 100644 --- a/staptree.h +++ b/staptree.h @@ -574,6 +574,7 @@ struct probe_point const token* tok; // points to first component's functor bool optional; bool sufficient; + expression* condition; void print (std::ostream& o) const; probe_point (); probe_point(std::vector const & comps,const token * t); @@ -590,8 +591,10 @@ struct probe const token* tok; std::vector locals; std::vector unused_locals; + expression* condition; probe (); void print (std::ostream& o) const; + void add_condition (expression* e); virtual void printsig (std::ostream &o) const; virtual void collect_derivation_chain (std::vector &probes_list); virtual probe* basest () { return this; } @@ -794,6 +797,7 @@ struct deep_copy_visitor: public visitor { std::stack targets; + static expression *deep_copy (expression *s); static statement *deep_copy (statement *s); static block *deep_copy (block *s); -- cgit