From e81d221cdd79da16f5f013ecb45ecbff192971fe Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 19 Jun 2015 12:35:26 +0200 Subject: Improved the HPMHookingGen parser It now strips gcc's __attribute__ from interface methods Signed-off-by: Haru --- tools/HPMHookGen/HPMHookGen.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/HPMHookGen') 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 -- cgit v1.2.3-60-g2f50