diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-08-11 14:45:58 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-08-11 14:45:58 -0400 |
commit | b391a1e0499d3cbafde11beeba8fb385465c1e64 (patch) | |
tree | 4cae2b6ced59b312372cad5e0282fa176466107c /tapsets.cxx | |
parent | ea384b8cf3a8b19aca2e4345169b19c3d887aeed (diff) | |
parent | 2ed8949fe42a23489b130716aea9fe8ce1e94b78 (diff) | |
download | systemtap-steved-b391a1e0499d3cbafde11beeba8fb385465c1e64.tar.gz systemtap-steved-b391a1e0499d3cbafde11beeba8fb385465c1e64.tar.xz systemtap-steved-b391a1e0499d3cbafde11beeba8fb385465c1e64.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
* 'master' of ssh://sources.redhat.com/git/systemtap:
PR5049: prefix with "*" any filenames given in "fn@filename:line" probes
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 639af099..d4745b9f 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -855,9 +855,14 @@ struct dwflpp bool cu_name_matches(string pattern) { assert(cu); - bool t = (fnmatch(pattern.c_str(), cu_name.c_str(), 0) == 0); + + // PR 5049: implicit * in front of given path pattern. + // NB: fnmatch() is used without FNM_PATHNAME. + string prefixed_pattern = string("*") + pattern; + + bool t = (fnmatch(prefixed_pattern.c_str(), cu_name.c_str(), 0) == 0); if (t && sess.verbose>3) - clog << "pattern '" << pattern << "' " + clog << "pattern '" << prefixed_pattern << "' " << "matches " << "CU '" << cu_name << "'" << "\n"; return t; @@ -1365,13 +1370,17 @@ struct dwflpp size_t nfiles; Dwarf_Files *srcfiles; + // PR 5049: implicit * in front of given path pattern. + // NB: fnmatch() is used without FNM_PATHNAME. + string prefixed_pattern = string("*") + pattern; + dwarf_assert ("dwarf_getsrcfiles", dwarf_getsrcfiles (cu, &srcfiles, &nfiles)); { for (size_t i = 0; i < nfiles; ++i) { char const * fname = dwarf_filesrc (srcfiles, i, NULL, NULL); - if (fnmatch (pattern.c_str(), fname, 0) == 0) + if (fnmatch (prefixed_pattern.c_str(), fname, 0) == 0) { filtered_srcfiles.insert (fname); if (sess.verbose>2) |