summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-07-22 13:51:51 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-07-22 13:51:51 (GMT)
commitb56f0119896adefa8e55bebf0c151f8fcef5d33f (patch)
tree17be114da3f1ca32b431b4d07bd9dac839783d0e /bin
parent0aa506cc6cc9e3d054dd98e46add8e6a6e492f7e (diff)
downloadhdf5-b56f0119896adefa8e55bebf0c151f8fcef5d33f.zip
hdf5-b56f0119896adefa8e55bebf0c151f8fcef5d33f.tar.gz
hdf5-b56f0119896adefa8e55bebf0c151f8fcef5d33f.tar.bz2
[svn-r526] Changes since 19980721
---------------------- ./tools/h5ls.c If the dataset is of type H5T_NATIVE_CHAR then we print the value as a string. This is temporary -- I plan to add better control of this later but needed something now for debugging. ./src/H5Fistore.c Squashed a bug in the chunk caching code that caused the wrong chunk to be returned. ./bin/trace ./src/H5.c Added support for printing values of array arguments when the size of the array is supplied by some previous argument. You must declare the argument as an array in order for the automatic tracing stuff to work. For instance, the third argument of H5Pset_chunk() is an array whose size is determined by the second argument `ndims'. Here's how you should declare it: herr_t H5Pset_chunk(hid_t plist_id, intn rank, hsize_t dims[/*rank*/]) The comment inside the `[]' is the name of some previous integer argument (int, unsigned, size_t, ssize_t, hsize_t, hssize_t). The trace output will look something like: H5Pset_chunk(plist=1234567, rank=2, dims=0x112233 {11, 22}) Changed tracing so that data types are printed out symbolically when possible. Changed tracing so data type initializations are not printed. This used to be confusing because lots of H5Tcopy() and H5Tregister...() calls showed up before the applications first explicit API call. ./src/H5Ipublic.h Changed the file atom group from zero to one so printing of atoms during tracing is more consistent -- they're all big numbers now. ./src/H5A.c ./src/H5E.c ./src/H5F.c ./src/H5G.c ./src/H5Sselect.c ./src/H5T.c ./src/H5TB.c ./src/H5Z.c Accidently modified these when working on the tracing, but nothing should have changed. ./src/H5P.c Changed the definition of H5Pset_chunk() for tracing. ./src/H5S.c ./src/H5Spublic.h Changed the definitions of H5Sset_extent_simple() and H5Screate_simple() for tracing. Changed the FUNC_ENTER() name for H5Screate_simple() so tracing shows the correct name.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/trace32
1 files changed, 25 insertions, 7 deletions
diff --git a/bin/trace b/bin/trace
index c1a1acc..3ab902e 100755
--- a/bin/trace
+++ b/bin/trace
@@ -80,7 +80,7 @@ sub errmesg ($$@) {
#
sub argstring ($$$) {
my ($file, $func, $atype) = @_;
- my ($ptr, $tstr) = (0,"!");
+ my ($ptr, $tstr, $array) = (0, "!", "");
my ($fq_atype);
# Normalize the data type by removing redundant white space,
@@ -91,8 +91,12 @@ sub argstring ($$$) {
$ptr = length $1 if $atype =~ s/(\*+)//;
$atype =~ s/^\s+//;
$atype =~ s/\s+$//;
+ if ($atype =~ /(.*)\[(.*)\]$/) {
+ ($array, $atype) = ($2, $1);
+ }
$fq_atype = $atype . ('*' x $ptr);
+
if ($ptr>0 && exists $TypeString{$fq_atype}) {
$ptr = 0;
$tstr = $TypeString{$fq_atype};
@@ -104,7 +108,7 @@ sub argstring ($$$) {
} else {
$tstr = $TypeString{$atype};
}
- return ("*" x $ptr) . $tstr;
+ return ("*" x $ptr) . ($array?"[$array]":"") . $tstr;
}
##############################################################################
@@ -129,15 +133,18 @@ sub rewrite_func ($$$$$) {
# comma, then split the arguments on commas.
$args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g;
my @args = split /,[\s\n]*/, $args;
+ my $argno = 0;
+ my %names;
for $arg (@args) {
unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**)
- ([a-z_A-Z]\w*)(\[\])?
+ ([a-z_A-Z]\w*)(\[.*?\])?
(\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);
+ $names{$aname} = $argno++;
$adir ||= "in";
$atype =~ s/\s+$//;
push @arg_name, $aname;
@@ -145,7 +152,18 @@ sub rewrite_func ($$$$$) {
if ($adir eq "out") {
push @arg_str, "x";
} else {
- $atype .= "*" if $array;
+ if (defined $array) {
+ $atype .= "*";
+ if ($array =~ /^\[\/\*([a-z_A-Z]\w*)\*\/\]$/) {
+ my $asize = $1;
+ if (exists $names{$asize}) {
+ $atype .= '[a' . $names{$asize} . ']';
+ } else {
+ warn "bad array size: $asize";
+ $atype .= "*";
+ }
+ }
+ }
push @arg_str, argstring $file, $name, $atype;
}
}
@@ -185,7 +203,7 @@ sub rewrite_func ($$$$$) {
error:
- return "\n$type\n$name ($args)$body";
+ return "\n$type\n$name ($args)\n$body";
}
##############################################################################
@@ -203,8 +221,8 @@ for $file (@ARGV) {
my $original = $Source;
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
+ \s*\((.*?)\)\s* #args
+ (\{.*?\n\}[^\n]*) #body
/rewrite_func($file,$1,$3,$4,$5)/segx;
$total_api += $napi;