diff options
author | Josh Stone <jistone@redhat.com> | 2009-04-21 12:57:37 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-04-21 12:57:37 -0700 |
commit | 8b31197b0c87947c37061c3a5493daa4e6927d56 (patch) | |
tree | b5d59a6ea8b1d155cce714350eb807d643341e0f /tapsets.cxx | |
parent | cff7feda3e990bb554f39dbf5d8055256dca5af5 (diff) | |
download | systemtap-steved-8b31197b0c87947c37061c3a5493daa4e6927d56.tar.gz systemtap-steved-8b31197b0c87947c37061c3a5493daa4e6927d56.tar.xz systemtap-steved-8b31197b0c87947c37061c3a5493daa4e6927d56.zip |
Use tokenize() for splitting @cast's module list
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index e43bc30b..c4bfa488 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -5194,13 +5194,13 @@ void dwarf_cast_expanding_visitor::visit_cast_op (cast_op* e) string code; exp_type type = pe_long; - size_t mod_end = ~0; - do + + // split the module string by ':' for alternatives + vector<string> modules; + tokenize(e->module, modules, ":"); + for (unsigned i = 0; code.empty() && i < modules.size(); ++i) { - // split the module string by ':' for alternatives - size_t mod_begin = mod_end + 1; - mod_end = e->module.find(':', mod_begin); - string module = e->module.substr(mod_begin, mod_end - mod_begin); + string& module = modules[i]; filter_special_modules(module); // NB: This uses '/' to distinguish between kernel modules and userspace, @@ -5255,7 +5255,6 @@ void dwarf_cast_expanding_visitor::visit_cast_op (cast_op* e) dwarf_cast_query q (*dw, module, *e, lvalue, type, code); dw->query_modules(&q); } - while (code.empty() && mod_end != string::npos); if (code.empty()) { |