public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Patch RFC] Tolerate if nsrcs>1 in iterate_over_srcfile_lines
@ 2013-06-13  6:37 Jia He
  2013-06-13 15:08 ` Frank Ch. Eigler
  0 siblings, 1 reply; 6+ messages in thread
From: Jia He @ 2013-06-13  6:37 UTC (permalink / raw)
  To: systemtap

Now if dwarf_getsrc_file returns by nsrcs>1 in
dwflpp::iterate_over_srcfile_lines,
The loop for (int l = lineno; ; l = l + 1) will not be continued.
But actually it is not correct in some cases.
--- systemtap-2.2.1.orig/dwflpp.cxx     2013-05-16 10:30:37.000000000 -0400
+++ systemtap-2.2.1/dwflpp.cxx  2013-06-13 01:59:52.000000000 -0400
@@ -1619,7 +1619,7 @@ dwflpp::iterate_over_srcfile_lines (char
          if (line_type == RANGE && lineno > lines[1])
             break;
           line_probed = lines_probed.insert(lineno);
-          if (lineno != l || line_probed.second == false || nsrcs > 1)
+          if (lineno != l || line_probed.second == false)
             continue;
           dwarf_lineaddr (srcsp [0], &line_addr);
           if (!function_name_matches(func_pattern) && dwarf_haspc
(function, line_addr) != 1)
@@ -1677,7 +1677,9 @@ dwflpp::iterate_over_srcfile_lines (char
                 advice << srcfile << ":" << hi_try;
               advice << ")";
             }
-          throw semantic_error (advice.str());
+          if (sess.verbose > 0)
+            clog<<advice.str();
+//          throw semantic_error (advice.str());
         }

       for (size_t i = 0; i < nsrcs; ++i)


test result
command:stap -L 'kernel.statement("sys_nanosleep@kernel/hrtimer.c:*")'
in X86_64)
Before this patch:
kernel.statement("sys_nanosleep@kernel/hrtimer.c:1612") $rmtp:struct
timespec* $tu:struct timespec

After this patch:
kernel.statement("sys_nanosleep@kernel/hrtimer.c:1602") $rqtp:struct
timespec* $rmtp:struct timespec* $tu:struct timespec
kernel.statement("sys_nanosleep@kernel/hrtimer.c:1605") $rqtp:struct
timespec* $rmtp:struct timespec* $tu:struct timespec
kernel.statement("sys_nanosleep@kernel/hrtimer.c:1608") $rmtp:struct
timespec* $tu:struct timespec
kernel.statement("sys_nanosleep@kernel/hrtimer.c:1611") $rmtp:struct
timespec* $tu:struct timespec
kernel.statement("sys_nanosleep@kernel/hrtimer.c:1612") $rmtp:struct
timespec* $tu:struct timespec

in ppc64)
Before:
<null result>

After:
kernel.statement("SyS_
nanosleep@kernel/hrtimer.c:1601") $rmtp:long int
kernel.statement("SyS_nanosleep@kernel/hrtimer.c:1605") $rqtp:long int
$rmtp:long int
kernel.statement("SyS_nanosleep@kernel/hrtimer.c:1608") $rmtp:long int
kernel.statement("SyS_nanosleep@kernel/hrtimer.c:1611") $rmtp:long int

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-26 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-13  6:37 [Patch RFC] Tolerate if nsrcs>1 in iterate_over_srcfile_lines Jia He
2013-06-13 15:08 ` Frank Ch. Eigler
2013-06-14  2:13   ` Jia He
2013-06-18  0:31     ` Jia He
2013-06-26 15:04       ` David Smith
2013-06-26 16:54         ` David Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).