diff options
-rw-r--r-- | tapsets.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 511289df..9a8524b1 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8350,11 +8350,33 @@ kprobe_derived_probe::kprobe_derived_probe (probe *base, #define USHRT_MAX 32767 #endif - // Expansion of $target variables in the probe body produces an error during translate phase + // Expansion of $target variables in the probe body produces an error during + // translate phase, since we're not using debuginfo + vector<probe_point::component*> comps; + comps.push_back (new probe_point::component(TOK_KPROBE)); - if (has_return) - comps.push_back (new probe_point::component(TOK_RETURN)); + if (has_statement) + { + comps.push_back (new probe_point::component(TOK_STATEMENT, new literal_number(addr))); + comps.push_back (new probe_point::component(TOK_ABSOLUTE)); + } + else + { + size_t pos = name.find(':'); + if (pos != string::npos) + { + string module = name.substr(0, pos); + string function = name.substr(pos + 1); + comps.push_back (new probe_point::component(TOK_MODULE, new literal_string(module))); + comps.push_back (new probe_point::component(TOK_FUNCTION, new literal_string(function))); + } + else + comps.push_back (new probe_point::component(TOK_FUNCTION, new literal_string(name))); + + if (has_return) + comps.push_back (new probe_point::component(TOK_RETURN)); + } this->sole_location()->components = comps; } |