From: Florian Krohm Date: Wed, 18 Sep 2013 09:15:23 +0000 (+0000) Subject: Tweak filter_xml_frames. Suppress frames containing neither a X-Git-Tag: svn/VALGRIND_3_9_0~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9016099c5adf87c0e303ca18dc5df9ebc70c41c;p=thirdparty%2Fvalgrind.git Tweak filter_xml_frames. Suppress frames containing neither a function name nor any source code reference. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13559 --- diff --git a/tests/filter_xml_frames b/tests/filter_xml_frames index fc92542a4d..f1fa3f070e 100755 --- a/tests/filter_xml_frames +++ b/tests/filter_xml_frames @@ -1,14 +1,23 @@ #! /usr/bin/env perl -# Remove ..... containing an poining to -# some system library. +# Remove certain ..... records that are suspected to point +# to some kind of system library. Those are +# - frames with /lib/.... +# - frames with /usr/lib/.... +# - frames without source informatino and without a function name +# +# There may be others... use strict; use warnings; my $in_frame = 0; my $frame = ""; -my $ignore_frame = 0; + +# Info about the current frame +my $has_source_info = 0; # , , +my $has_function_name = 0; # +my $has_system_obj = 0; # /lib... or /usr/lib... while (my $line = <>) { @@ -16,7 +25,7 @@ while (my $line = <>) if ($line =~ //) { $frame = $line; $in_frame = 1; - $ignore_frame = 0 + $has_source_info = $has_function_name = $has_system_obj = 0; } else { print $line; } @@ -26,14 +35,19 @@ while (my $line = <>) # We're in a frame $frame .= $line; if ($line =~ /<\/frame>/) { +# Is this a frame we want to keep? + my $ignore_frame = $has_system_obj || + (! $has_source_info && ! $has_function_name); if (! $ignore_frame) { print $frame; } $in_frame = 0; } else { -# The may require tweaking; currently /lib and /usr/lib are matched - $ignore_frame = 1 if ($line =~ /\/lib/); - $ignore_frame = 1 if ($line =~ /\/usr\/lib/); + $has_source_info = 1 if ($line =~ /<(dir|file|line)>/); + $has_function_name = 1 if ($line =~ //); +# This may require tweaking; currently /lib and /usr/lib are matched + $has_system_obj = 1 if ($line =~ /\/lib/); + $has_system_obj = 1 if ($line =~ /\/usr\/lib/); } }