diff options
author | Haru <haru@dotalux.com> | 2015-06-19 12:35:26 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-06-19 12:38:06 +0200 |
commit | e81d221cdd79da16f5f013ecb45ecbff192971fe (patch) | |
tree | eddd9f2bd60158a511b77fe393d2be6a2d6dbb7e /tools/HPMHookGen | |
parent | 97a41b5b834ef0d37240bc004028952be9f17aee (diff) | |
download | hercules-e81d221cdd79da16f5f013ecb45ecbff192971fe.tar.gz hercules-e81d221cdd79da16f5f013ecb45ecbff192971fe.tar.bz2 hercules-e81d221cdd79da16f5f013ecb45ecbff192971fe.tar.xz hercules-e81d221cdd79da16f5f013ecb45ecbff192971fe.zip |
Improved the HPMHookingGen parser
It now strips gcc's __attribute__ from interface methods
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'tools/HPMHookGen')
-rwxr-xr-x | tools/HPMHookGen/HPMHookGen.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl index 4fa548e44..f97eefb84 100755 --- a/tools/HPMHookGen/HPMHookGen.pl +++ b/tools/HPMHookGen/HPMHookGen.pl @@ -21,6 +21,11 @@ sub trim($) { sub parse($$) { my ($p, $d) = @_; + + # Strip gcc attributes + $p =~ s/\s*__attribute__\s*\(\(.*$//; + $d =~ s/\s*__attribute__\s*\(\(.*$//; + $p =~ s/^.*?\)\((.*)\).*$/$1/; # Clean up extra parentheses )(around the arglist) # Retrieve return type |