summaryrefslogtreecommitdiffstats
path: root/bin/trace
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-07-07 20:13:31 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-07-07 20:13:31 (GMT)
commitbcf649388cb246fecf5bac670c54c7c4d654eb44 (patch)
treee73f696a48020d756c3eeda3c633047ef2465bfa /bin/trace
parent63be23d70dd9bb3d79d670bb94e26c829a4abc2e (diff)
downloadhdf5-bcf649388cb246fecf5bac670c54c7c4d654eb44.zip
hdf5-bcf649388cb246fecf5bac670c54c7c4d654eb44.tar.gz
hdf5-bcf649388cb246fecf5bac670c54c7c4d654eb44.tar.bz2
[svn-r460] Changes since 19980707
---------------------- ./bin/trace ./src/H5.c ./src/H5private.h ./src/H5A.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5P.c ./src/H5Pprivate.h ./src/H5S.c ./src/H5T.c Output-only arguments have their addresses printed during tracing and added symbolic output for the H5F_driver_t arguments. That's another reason that we should be careful to add `/*out*/' after arguments that are output-only and `/*in,out*/' after arguments that are used for both input and output values. No internal function calls H5Pget_class() anymore. ./src/H5T.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5Tpublic.h Added H5Tget_overflow() and H5Tset_overflow() so the application can query or set a function that will be called whenever an overflow occurs. Implemented as documented in previous e-mail except the overflow handler gets two buffers: one that contains the source value and one to receive the optional destination value. ./test/dtypes.c Tests overflow handler. ./src/H5.c We have to declare fdopen() because I'm getting errors when compiling on Irix64 even though we include <stdio.h> as documented in the fdopen() man page.
Diffstat (limited to 'bin/trace')
-rwxr-xr-xbin/trace32
1 files changed, 24 insertions, 8 deletions
diff --git a/bin/trace b/bin/trace
index f190857..7f39809 100755
--- a/bin/trace
+++ b/bin/trace
@@ -21,6 +21,7 @@ $Source = "";
"herr_t" => "e",
"H5E_direction_t" => "Ed",
"H5E_error_t*" => "Ee",
+ "H5F_driver_t" => "Fd",
"H5G_link_t" => "Gl",
"H5G_stat_t*" => "Gs",
"hsize_t" => "h",
@@ -47,7 +48,9 @@ $Source = "";
"H5E_auto_t" => "x",
"H5E_walk_t" => "x",
"H5G_iterate_t" => "x",
+ "H5T_cdata_t**" => "x",
"H5T_conv_t" => "x",
+ "H5T_overflow_t" => "x",
"H5Z_func_t" => "x",
"size_t" => "z",
"H5Z_method_t" => "Zm",
@@ -76,6 +79,7 @@ sub errmesg ($$@) {
sub argstring ($$$) {
my ($file, $func, $atype) = @_;
my ($ptr, $tstr) = (0,"!");
+ my ($fq_atype);
# Normalize the data type by removing redundant white space,
# certain type qualifiers, and indirection.
@@ -85,8 +89,12 @@ sub argstring ($$$) {
$ptr = length $1 if $atype =~ s/(\*+)//;
$atype =~ s/^\s+//;
$atype =~ s/\s+$//;
-
- if ($ptr>0 && exists $TypeString{"$atype*"}) {
+ $fq_atype = $atype . ('*' x $ptr);
+
+ if ($ptr>0 && exists $TypeString{$fq_atype}) {
+ $ptr = 0;
+ $tstr = $TypeString{$fq_atype};
+ } elsif ($ptr>0 && exists $TypeString{"$atype*"}) {
--$ptr;
$tstr = $TypeString{"$atype*"};
} elsif (!exists $TypeString{$atype}) {
@@ -113,23 +121,31 @@ sub rewrite_func ($$$$$) {
# Parse arguments
if ($args eq "void") {
- $trace = "H5TRACE0(\"$rettype\", \"\");\n";
+ $trace = "H5TRACE0(\"$rettype\",\"\");\n";
} else {
+ # Split arguments. First convert `/*in,out*/' to get rid of the
+ # comma, then split the arguments on commas.
+ $args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g;
my @args = split /,[\s\n]*/, $args;
+
for $arg (@args) {
unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**)
([a-z_A-Z]\w*)(\[\])?
- (\s*\/\*\s*(in|out|in,\s*out)\s*\*\/)?\s*$/x) {
+ (\s*\/\*\s*(in|out|in_out)\s*\*\/)?\s*$/x) {
errmesg $file, $name, "unable to parse \`$arg\'";
goto error;
} else {
my ($atype, $aname, $array, $adir) = ($1, $3, $4, $6);
$adir ||= "in";
- next if $adir eq "out";
$atype =~ s/\s+$//;
- $atype .= "*" if $array;
push @arg_name, $aname;
- push @arg_str, argstring $file, $name, $atype;
+
+ if ($adir eq "out") {
+ push @arg_str, "x";
+ } else {
+ $atype .= "*" if $array;
+ push @arg_str, argstring $file, $name, $atype;
+ }
}
}
$trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\",\"";
@@ -183,7 +199,7 @@ for $file (@ARGV) {
# Make modifications
my $original = $Source;
- my $napi = $Source =~ s/\n([a-z]\w*(\s+[a-z]\w*)*)\s*\n #type
+ my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[a-z]\w*)*)\s*\n #type
(H5[A-Z]{1,2}[^_A-Z]\w*) #name
\s*\((.*?)\) #args
(.*?\n\}[^\n]*) #body