aboutsummaryrefslogtreecommitdiff
path: root/tests/filter_xml_frames
diff options
context:
space:
mode:
authorflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2013-09-17 20:15:36 +0000
committerflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2013-09-17 20:15:36 +0000
commitc5325ef4145563bdc607ef6cb74272afbafb9a27 (patch)
tree76695bd22344c54b4f79598dce02cba4f7f2726e /tests/filter_xml_frames
parenteb577d7ec674109215260d7ade34320527e45ffb (diff)
downloadvalgrind-c5325ef4145563bdc607ef6cb74272afbafb9a27.tar.gz
Followup to r13553 which caused some build failures.
(1) Detect availability of pthread_setname_np. Ignore testcases memcheck/tests/threadname[_xml] if not available. (2) Enable _GNU_SOURCE to avold compiler warnings. (3) In threadname_xml filter out stackframes referring to system libraries. Added tests/filter_xml_frames to do that. (4) Adjust .exp files as needed (5) Do not ship stdout.exp for memcheck/tests/threadname[_xml]. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13557 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'tests/filter_xml_frames')
-rwxr-xr-xtests/filter_xml_frames40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/filter_xml_frames b/tests/filter_xml_frames
new file mode 100755
index 000000000..fc92542a4
--- /dev/null
+++ b/tests/filter_xml_frames
@@ -0,0 +1,40 @@
+#! /usr/bin/env perl
+
+# Remove <frame>.....</frame> containing an <obj> poining to
+# some system library.
+
+use strict;
+use warnings;
+
+my $in_frame = 0;
+my $frame = "";
+my $ignore_frame = 0;
+
+while (my $line = <>)
+{
+ if (! $in_frame) {
+ if ($line =~ /<frame>/) {
+ $frame = $line;
+ $in_frame = 1;
+ $ignore_frame = 0
+ } else {
+ print $line;
+ }
+ next;
+ }
+
+# We're in a frame
+ $frame .= $line;
+ if ($line =~ /<\/frame>/) {
+ 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 =~ /<obj>\/lib/);
+ $ignore_frame = 1 if ($line =~ /<obj>\/usr\/lib/);
+ }
+}
+
+exit 0;