From a3b4f52cd67ff11dfc12e8e878744ea1319308ef Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 27 Aug 2009 15:43:51 -0700 Subject: PR10568: Ensure that aliases pull in their tapset When a probe alias is resolved in a tapset, the contents of that tapset should be included in the compiled script, just as we do for global variables and functions. * elaborate.cxx (alias_expansion_builder::build): When an alias is instantiated, add its stapfile to the session files. * testsuite/systemtap.base/tapset_includes.exp: New test. * testsuite/systemtap.base/tapset/*.stp: Testing tapsets for above. --- elaborate.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index bf57f88f..17f335d0 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -540,7 +540,18 @@ alias_expansion_builder else n->body = new block (alias->body, use->body); + unsigned old_num_results = finished_results.size(); derive_probes (sess, n, finished_results, location->optional); + + // Check whether we resolved something. If so, put the + // whole library into the queue if not already there. + if (finished_results.size() > old_num_results) + { + stapfile *f = alias->tok->location.file; + if (find (sess.files.begin(), sess.files.end(), f) + == sess.files.end()) + sess.files.push_back (f); + } } bool checkForRecursiveExpansion (probe *use) -- cgit