rjwalsh | e4e779d | 2004-04-16 23:02:29 +0000 | [diff] [blame^] | 1 | #!/usr/bin/perl |
| 2 | |
| 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 | |
| 26 | use strict; |
| 27 | use warnings; |
| 28 | |
| 29 | while(<>) { |
| 30 | if(/VG_INTERCEPT\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/) { |
| 31 | my $ver = $1 . ":" . $2; |
| 32 | $ver =~ s/\*/\$2A/g; |
| 33 | $ver =~ s/\+/\$2B/g; |
| 34 | $ver =~ s/\-/\$2D/g; |
| 35 | $ver =~ s/\./\$2E/g; |
| 36 | $ver =~ s/\:/\$3A/g; |
| 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; |
| 40 | $ver =~ s/\*/\$2A/g; |
| 41 | $ver =~ s/\+/\$2B/g; |
| 42 | $ver =~ s/\-/\$2D/g; |
| 43 | $ver =~ s/\./\$2E/g; |
| 44 | $ver =~ s/\:/\$3A/g; |
| 45 | s/VG_INTERCEPT_ALIAS\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/VG_INTERCEPT_ALIAS($ver)/g; |
| 46 | } |
| 47 | print $_; |
| 48 | } |