blob: 18fed7c7e67e0086de068052031c2dd8b9e840b9 [file] [log] [blame]
thughesd64e87d2004-11-02 09:45:21 +00001#!/usr/bin/perl -w
rjwalshe4e779d2004-04-16 23:02:29 +00002
njnb9c427c2004-12-01 14:14:42 +00003# This file is part of Valgrind, a dynamic binary instrumentation
4# framework.
rjwalshe4e779d2004-04-16 23:02:29 +00005#
njn53612422005-03-12 16:22:54 +00006# Copyright (C) 2000-2005 Julian Seward
rjwalshe4e779d2004-04-16 23:02:29 +00007# jseward@acm.org
8#
9# This program is free software; you can redistribute it and/or
10# modify it under the terms of the GNU General Public License as
11# published by the Free Software Foundation; either version 2 of the
12# License, or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22# 02111-1307, USA.
23#
24# The GNU General Public License is contained in the file COPYING.
25
26use strict;
rjwalshe4e779d2004-04-16 23:02:29 +000027
28while(<>) {
29 if(/VG_INTERCEPT\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/) {
30 my $ver = $1 . ":" . $2;
njnca0518d2004-11-26 19:34:36 +000031 ($ver =~ /J/) and die "Argh, 'J' in intercept muck...";
32 $ver =~ s/\*/J2A/g;
33 $ver =~ s/\+/J2B/g;
34 $ver =~ s/\-/J2D/g;
35 $ver =~ s/\./J2E/g;
36 $ver =~ s/\:/J3A/g;
rjwalshe4e779d2004-04-16 23:02:29 +000037 s/VG_INTERCEPT\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/VG_INTERCEPT($ver)/g;
38 } elsif(/VG_INTERCEPT_ALIAS\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/) {
39 my $ver = $1 . ":" . $2;
njnca0518d2004-11-26 19:34:36 +000040 ($ver =~ /J/) and die "Argh, 'J' in intercept muck...";
41 $ver =~ s/\*/J2A/g;
42 $ver =~ s/\+/J2B/g;
43 $ver =~ s/\-/J2D/g;
44 $ver =~ s/\./J2E/g;
45 $ver =~ s/\:/J3A/g;
rjwalshe4e779d2004-04-16 23:02:29 +000046 s/VG_INTERCEPT_ALIAS\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/VG_INTERCEPT_ALIAS($ver)/g;
47 }
48 print $_;
49}