summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-06-19 12:35:26 +0200
committerHaru <haru@dotalux.com>2015-06-19 12:38:06 +0200
commite81d221cdd79da16f5f013ecb45ecbff192971fe (patch)
treeeddd9f2bd60158a511b77fe393d2be6a2d6dbb7e
parent97a41b5b834ef0d37240bc004028952be9f17aee (diff)
downloadhercules-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>
-rwxr-xr-xtools/HPMHookGen/HPMHookGen.pl5
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