|
From: <sv...@va...> - 2006-09-12 21:09:21
|
Author: sewardj
Date: 2006-09-12 22:09:17 +0100 (Tue, 12 Sep 2006)
New Revision: 6056
Log:
Merge r6044 (callgrind: fix annotate script for data produced with
--dump-instr=3Dyes) (JosefW)
Modified:
branches/VALGRIND_3_2_BRANCH/callgrind/callgrind_annotate.in
Modified: branches/VALGRIND_3_2_BRANCH/callgrind/callgrind_annotate.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/callgrind/callgrind_annotate.in 2006-09-=
12 21:07:53 UTC (rev 6055)
+++ branches/VALGRIND_3_2_BRANCH/callgrind/callgrind_annotate.in 2006-09-=
12 21:09:17 UTC (rev 6056)
@@ -483,6 +483,7 @@
my $curr_fn;
my $curr_name;
my $curr_line_num =3D 0;
+ my $prev_line_num =3D 0;
=20
my $curr_cobj =3D "";
my $curr_cfile =3D "";
@@ -496,17 +497,19 @@
=20
# Read body of input file.
while (<INPUTFILE>) {
+ $prev_line_num =3D $curr_line_num;
+
s/#.*$//; # remove comments
- s/^\+(\d+)/$curr_line_num+$1/e;
- s/^\-(\d+)/$curr_line_num-$1/e;
- s/^\*/$curr_line_num/e;
- if (s/^(\d+|0x\w+)\s+//) {
+ s/^\+(\d+)/$prev_line_num+$1/e;
+ s/^\-(\d+)/$prev_line_num-$1/e;
+ s/^\*/$prev_line_num/e;
+ if (s/^(-?\d+|0x\w+)\s+//) {
$curr_line_num =3D $1;
if ($has_addr) {
if ($has_line) {
- s/^\+(\d+)/$curr_line_num+$1/e;
- s/^\-(\d+)/$curr_line_num-$1/e;
- s/^\*/$curr_line_num/e;
+ s/^\+(\d+)/$prev_line_num+$1/e;
+ s/^\-(\d+)/$prev_line_num-$1/e;
+ s/^\*/$prev_line_num/e;
=20
if (s/^(\d+)\s+//) { $curr_line_num =3D $1; }
}
|