diff options
author | Josh Stone <jistone@redhat.com> | 2009-09-16 19:38:20 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-09-16 19:38:20 -0700 |
commit | 7d6d0afc24b43829511f3f1d0aeff0fefff56b54 (patch) | |
tree | fa0e55f71448e92074c5c5ef8bde4098bdf76fb7 /dwflpp.h | |
parent | 04ddd303348c0ffb71c6f57eacb2282bd1d61b3a (diff) | |
download | systemtap-steved-7d6d0afc24b43829511f3f1d0aeff0fefff56b54.tar.gz systemtap-steved-7d6d0afc24b43829511f3f1d0aeff0fefff56b54.tar.xz systemtap-steved-7d6d0afc24b43829511f3f1d0aeff0fefff56b54.zip |
PR10461: Match C++ scopes for namespaces and classes
The function spec for dwarf probes now supports scopes, so you can limit
the probes to specific namespaces or classes. Multiple scopes can be
specified, and they will be matched progressively outward.
probe process("foo").function("std::vector<*>::*") { ... }
probe process("foo").function("::global_function") { ... }
* dwflpp.cxx (dwflpp::get_parent_scope): New, finds the containing
scopes of the specified DIE.
(dwflpp::function_scope_matches): New, checks that the scopes
containing the function all match the given scope patterns.
* tapsets.cxx (dwarf_query::parse_function_spec): Rewrite, now handles
multiple scope separators too.
(query_dwarf_func): Check that the functions scopes match.
Diffstat (limited to 'dwflpp.h')
-rw-r--r-- | dwflpp.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -192,6 +192,7 @@ struct dwflpp bool function_name_matches_pattern(const std::string& name, const std::string& pattern); bool function_name_matches(const std::string& pattern); + bool function_scope_matches(const std::vector<std::string> scopes); void iterate_over_modules(int (* callback)(Dwfl_Module *, void **, const char *, Dwarf_Addr, @@ -304,6 +305,8 @@ private: void cache_die_parents(cu_die_parent_cache_t* parents, Dwarf_Die* die); cu_die_parent_cache_t *get_die_parents(); + Dwarf_Die* get_parent_scope(Dwarf_Die* die); + /* The global alias cache is used to resolve any DIE found in a * module that is stubbed out with DW_AT_declaration with a defining * DIE found in a different module. The current assumption is that |