summaryrefslogtreecommitdiffstats
path: root/bin/trace
diff options
context:
space:
mode:
Diffstat (limited to 'bin/trace')
-rwxr-xr-xbin/trace31
1 files changed, 9 insertions, 22 deletions
diff --git a/bin/trace b/bin/trace
index a2052ce..0eef8ce 100755
--- a/bin/trace
+++ b/bin/trace
@@ -283,8 +283,8 @@ my $file_api = 0;
my $file_args = 0;
my $total_api = 0;
my $total_args = 0;
-sub rewrite_func ($$$$$$$$) {
- my ($file, $begin, $type, $aftertype, $name, $args, $close, $body) = @_;
+sub rewrite_func ($$$$$) {
+ my ($file, $type, $name, $args, $body) = @_;
my ($arg, $trace, $argtrace);
my (@arg_name, @arg_str, @arg_type);
local $_;
@@ -459,7 +459,7 @@ sub rewrite_func ($$$$$$$$) {
}
error:
- return "\n$begin$type$aftertype$name($orig_args)$close$body";
+ return "\n$type\n$name($orig_args)\n$body";
}
##############################################################################
@@ -481,25 +481,12 @@ for $file (@ARGV) {
# Make a copy of the original data
my $original = $Source;
- # Check which style of function declaration is used in this file
- if ( $Source =~ /BEGIN_FUNC/ ) {
- # Make modifications
- $Source =~ s/\n(BEGIN_FUNC.*?\n) #begin
- ([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**) #type
- (.*?\n) #aftertype
- (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
- \s*\((.*?)\)\s* #args
- (\)) #close
- (\n.*?\nEND_FUNC\([^\n]*) #body
- /rewrite_func($file,$1,$2,$4,$5,$6,$7,$8)/segx;
- } else {
- # Make modifications
- $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
- (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
- \s*\((.*?)\)\s* #args
- (\{.*?\n\}[^\n]*) #body
- /rewrite_func($file,"",$1,"\n",$3,$4,"\n",$5)/segx;
- }
+ # Make modifications
+ $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
+ (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
+ \s*\((.*?)\)\s* #args
+ (\{.*?\n\}[^\n]*) #body
+ /rewrite_func($file,$1,$3,$4,$5)/segx;
# If the source changed then print out the new version
if ($original ne $Source) {