thughes | d64e87d | 2004-11-02 09:45:21 +0000 | [diff] [blame] | 1 | #!/usr/bin/perl -w |
rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame] | 2 | |
njn | b9c427c | 2004-12-01 14:14:42 +0000 | [diff] [blame] | 3 | # This file is part of Valgrind, a dynamic binary instrumentation |
| 4 | # framework. |
rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame] | 5 | # |
njn | 5361242 | 2005-03-12 16:22:54 +0000 | [diff] [blame] | 6 | # Copyright (C) 2000-2005 Julian Seward |
rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame] | 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 | |
| 26 | use strict; |
rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame] | 27 | |
| 28 | while(<>) { |
| 29 | if(/VG_INTERCEPT\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/) { |
| 30 | my $ver = $1 . ":" . $2; |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 31 | ($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; |
rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame] | 37 | 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; |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 40 | ($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; |
rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame] | 46 | s/VG_INTERCEPT_ALIAS\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/VG_INTERCEPT_ALIAS($ver)/g; |
| 47 | } |
| 48 | print $_; |
| 49 | } |