diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tapsets.cxx | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -8,6 +8,12 @@ 2005-09-12 Graydon Hoare <graydon@redhat.com> PR 1306 + * tapsets.cxx (dwflpp::iterate_over_srcfile_lines): Fix two + off-by-one errors in previous change. + +2005-09-12 Graydon Hoare <graydon@redhat.com> + + PR 1306 * tapsets.cxx (dwflpp::has_single_line_record): New function. (dwflpp::iterate_over_srcfile_lines): Throw when user requests single statement line with multiple records (and provide advice). diff --git a/tapsets.cxx b/tapsets.cxx index d7a2fb9b..7f3efcc1 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -599,7 +599,7 @@ dwflpp srcfile, lineno, 0, &srcsp, &nsrcs)); - if (need_single_match && nsrcs > 0) + if (need_single_match && nsrcs > 1) { // We wanted a single line record (a unique address for the // line) and we got a bunch of line records. We're going to @@ -610,7 +610,7 @@ dwflpp int lo_try = -1; int hi_try = -1; - for (size_t i = 0; i < 5; ++i) + for (size_t i = 1; i < 6; ++i) { if (lo_try == -1 && has_single_line_record(srcfile, lineno - i)) lo_try = lineno - i; |