blob: d522908fa692b957033efb72df07cc203cfcddc5 [file] [log] [blame]
thughesd64e87d2004-11-02 09:45:21 +00001#!/usr/bin/perl -w
rjwalshe4e779d2004-04-16 23:02:29 +00002
3# This file is part of Valgrind, an extensible x86 protected-mode
4# emulator for monitoring program execution on x86-Unixes.
5#
6# Copyright (C) 2000-2004 Julian Seward
7# 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;
31 $ver =~ s/\*/\$2A/g;
32 $ver =~ s/\+/\$2B/g;
33 $ver =~ s/\-/\$2D/g;
34 $ver =~ s/\./\$2E/g;
35 $ver =~ s/\:/\$3A/g;
36 s/VG_INTERCEPT\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/VG_INTERCEPT($ver)/g;
37 } elsif(/VG_INTERCEPT_ALIAS\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/) {
38 my $ver = $1 . ":" . $2;
39 $ver =~ s/\*/\$2A/g;
40 $ver =~ s/\+/\$2B/g;
41 $ver =~ s/\-/\$2D/g;
42 $ver =~ s/\./\$2E/g;
43 $ver =~ s/\:/\$3A/g;
44 s/VG_INTERCEPT_ALIAS\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/VG_INTERCEPT_ALIAS($ver)/g;
45 }
46 print $_;
47}