diff options
author | Josh Stone <jistone@redhat.com> | 2009-07-20 16:32:33 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-07-20 18:08:14 -0700 |
commit | 0c16d51256bc77c2b5497b72ec43b7864d2b47a8 (patch) | |
tree | 0246056854724aec3bf4d64b4cc6d1639e5867c6 /dwflpp.cxx | |
parent | a2639cb76e9151cad6ceebc21857d2d6aa8cbc8a (diff) | |
download | systemtap-steved-0c16d51256bc77c2b5497b72ec43b7864d2b47a8.tar.gz systemtap-steved-0c16d51256bc77c2b5497b72ec43b7864d2b47a8.tar.xz systemtap-steved-0c16d51256bc77c2b5497b72ec43b7864d2b47a8.zip |
Allow dwflpp to take a vector of module names
This will be used to load tracepoint modules as a bunch of little query
modules into a single dwflpp.
* dwflpp.cxx (setup_user): take a vector instead of a single module
(dwflpp::dwflpp): form a vector in the singular case, and add a
variant that takes and passes through a vector of modules.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r-- | dwflpp.cxx | 56 |
1 files changed, 36 insertions, 20 deletions
@@ -75,7 +75,21 @@ dwflpp::dwflpp(systemtap_session & session, const string& name, bool kernel_p): if (kernel_p) setup_kernel(name); else - setup_user(name); + { + vector<string> modules; + modules.push_back(name); + setup_user(modules); + } +} + + +dwflpp::dwflpp(systemtap_session & session, const vector<string>& names): + sess(session), module(NULL), module_bias(0), mod_info(NULL), + module_start(0), module_end(0), cu(NULL), dwfl(NULL), + module_dwarf(NULL), function(NULL), blacklist_enabled(false), + pc_cached_scopes(0), num_cached_scopes(0), cached_scopes(NULL) +{ + setup_user(names); } @@ -369,7 +383,7 @@ dwflpp::setup_kernel(const string& name, bool debuginfo_needed) void -dwflpp::setup_user(const string& module_name, bool debuginfo_needed) +dwflpp::setup_user(const vector<string>& modules, bool debuginfo_needed) { if (! sess.module_cache) sess.module_cache = new module_cache (); @@ -393,24 +407,26 @@ dwflpp::setup_user(const string& module_name, bool debuginfo_needed) throw semantic_error ("cannot open dwfl"); dwfl_report_begin (dwfl); - // XXX: should support buildid-based naming - - Dwfl_Module *mod = dwfl_report_offline (dwfl, - module_name.c_str(), - module_name.c_str(), - -1); - // XXX: save mod! - - if (debuginfo_needed) - dwfl_assert (string("missing process ") + - module_name + - string(" ") + - sess.architecture + - string(" debuginfo"), - mod); - - if (!module) - module = mod; + vector<string>::const_iterator it; + for (it = modules.begin(); it != modules.end(); ++it) + { + // XXX: should support buildid-based naming + + const string& module_name = *it; + Dwfl_Module *mod = dwfl_report_offline (dwfl, + module_name.c_str(), + module_name.c_str(), + -1); + // XXX: save mod! + + if (debuginfo_needed) + dwfl_assert (string("missing process ") + + module_name + + string(" ") + + sess.architecture + + string(" debuginfo"), + mod); + } // NB: the result of an _offline call is the assignment of // virtualized addresses to relocatable objects such as |