diff options
author | Josh Stone <jistone@redhat.com> | 2009-03-04 18:32:54 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-03-04 21:21:03 -0800 |
commit | dd22832afe6c337eb020001834266ad1e7678b2c (patch) | |
tree | 519d694b92e8c958ff112d3eec9629d82881d38f | |
parent | 345f6a4daad184385b7ee1dc3797f57a3be01452 (diff) | |
download | systemtap-steved-dd22832afe6c337eb020001834266ad1e7678b2c.tar.gz systemtap-steved-dd22832afe6c337eb020001834266ad1e7678b2c.tar.xz systemtap-steved-dd22832afe6c337eb020001834266ad1e7678b2c.zip |
Make session.module_cache init more consistently
We used to check & init module_cache in a few inconsistent places. Now
it is always handled in dwflpp::setup_user/setup_kernel.
* tapsets.cxx (dwflpp::setup_user): add module_cache check
(dwarf_builder::build): remove module_cache check
(dwarf_cast_expanding_visitor::visit_cast_op): ditto
-rw-r--r-- | tapsets.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 1c098425..7a321dce 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -958,6 +958,9 @@ struct dwflpp void setup_user(string module_name, bool debuginfo_needed = true) { + if (! sess.module_cache) + sess.module_cache = new module_cache (); + static const char *debuginfo_path_arr = "+:.debug:/usr/lib/debug:build"; static const char *debuginfo_env_arr = getenv("SYSTEMTAP_DEBUGINFO_PATH"); // NB: kernel_build_tree doesn't enter into this, as it's for @@ -4993,9 +4996,6 @@ void dwarf_cast_expanding_visitor::visit_cast_op (cast_op* e) if (e->module.empty()) e->module = "kernel"; // "*" may also be reasonable to search all kernel modules - if (! s.module_cache) - s.module_cache = new module_cache (); - string code; exp_type type = pe_long; try @@ -5655,10 +5655,6 @@ dwarf_builder::build(systemtap_session & sess, dwflpp* dw = 0; - if (! sess.module_cache) - sess.module_cache = new module_cache (); - - string module_name; if (has_null_param (parameters, TOK_KERNEL) || get_param (parameters, TOK_MODULE, module_name)) |