summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-08-05 22:58:46 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-08-05 23:08:44 -0400
commit9b988eff8c29377e658606a85f371ceb9acfef7d (patch)
tree8d77c25244a3c1c7f6b78063791b29af93d777d4 /dwflpp.cxx
parent3d9889977397098d14c5be50f1dfef1c3eeb508f (diff)
downloadsystemtap-steved-9b988eff8c29377e658606a85f371ceb9acfef7d.tar.gz
systemtap-steved-9b988eff8c29377e658606a85f371ceb9acfef7d.tar.xz
systemtap-steved-9b988eff8c29377e658606a85f371ceb9acfef7d.zip
PR10294: support wider range for statement probe
* dwflpp.cxx (iterate_over_srcfile_lines): Add pattern parameter. * dwflpp.h (iterate_over_srcfile_lines): Ditto. * testsuite/systemtap.base/bz10294.c: Test case. * testsuite/systemtap.base/bz10294.stp: Ditto. * testsuite/systemtap.base/bz6905.exp: Deleted. * testsuite/systemtap.base/statement.exp: Merge bz10294 with bz6905.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 6ede1d68..ff62265f 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -784,6 +784,7 @@ dwflpp::iterate_over_srcfile_lines (char const * srcfile,
enum line_t line_type,
void (* callback) (const dwarf_line_t& line,
void * arg),
+ const std::string& func_pattern,
void *data)
{
Dwarf_Line **srcsp = NULL;
@@ -811,7 +812,10 @@ dwflpp::iterate_over_srcfile_lines (char const * srcfile,
else if (line_type == RANGE) { /* correct lineno */
int start_lineno;
- function_line (&start_lineno);
+ if (name_has_wildcard(func_pattern)) /* PR10294: wider range like statement("*@foo.c") */
+ start_lineno = lineno;
+ else
+ function_line (&start_lineno);
lineno = lineno < start_lineno ? start_lineno : lineno;
if (lineno > lines[1]) { /* invalid line range */
stringstream advice;
@@ -849,7 +853,7 @@ dwflpp::iterate_over_srcfile_lines (char const * srcfile,
if (lineno != l || line_probed.second == false || nsrcs > 1)
continue;
dwarf_lineaddr (srcsp [0], &line_addr);
- if (dwarf_haspc (function, line_addr) != 1)
+ if (!function_name_matches(func_pattern) && dwarf_haspc (function, line_addr) != 1)
break;
}