summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-03-13 19:47:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-03-13 19:47:16 (GMT)
commitee3fdc2dbcdf9daaf4e41c085fddd37c1eadbcf9 (patch)
tree7cbd8c5fc545197f4efed76b9c317c817ebf791f /tools/misc
parentc619cf0f518bfea91a34136a1424951eb17b99a4 (diff)
downloadhdf5-ee3fdc2dbcdf9daaf4e41c085fddd37c1eadbcf9.zip
hdf5-ee3fdc2dbcdf9daaf4e41c085fddd37c1eadbcf9.tar.gz
hdf5-ee3fdc2dbcdf9daaf4e41c085fddd37c1eadbcf9.tar.bz2
[svn-r12084] Purpose:
Code checkpoint Description: The fractal heap code is reasonably stable and is passing all its current tests, so checkpoint everything with CVS. Also, add "statistics" module for v2 B-trees code, which is only a stub right now. Platforms tested: FreeBSD 4.11 (sleipnir) Mac OSX (amazon) Linux 2.4 (chicago)
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5debug.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index ca26c5d..9781d42 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -152,6 +152,14 @@ main(int argc, char *argv[])
/*
* Debug a symbol table node.
*/
+
+ /* Check for extra parameters */
+ if(extra == 0) {
+ fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
+ fprintf(stderr, "Symbol table node usage:\n");
+ fprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n");
+ } /* end if */
+
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
} else if(!HDmemcmp(sig, H5B_MAGIC, H5B_SIZEOF_MAGIC)) {
@@ -165,10 +173,25 @@ main(int argc, char *argv[])
switch(subtype) {
case H5B_SNODE_ID:
+ /* Check for extra parameters */
+ if(extra == 0) {
+ fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
+ fprintf(stderr, "B-tree symbol table node usage:\n");
+ fprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
+ } /* end if */
+
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
break;
case H5B_ISTORE_ID:
+ /* Check for extra parameters */
+ if(extra == 0) {
+ fprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
+ fprintf(stderr, "B-tree chunked storage node usage:\n");
+ fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n");
+ HDexit(4);
+ } /* end if */
+
ndims = (unsigned)extra;
status = H5D_istore_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims);
break;
@@ -204,6 +227,14 @@ main(int argc, char *argv[])
*/
H5B2_subid_t subtype = (H5B2_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
+ /* Check for enough valid parameters */
+ if(extra == 0 || extra2 == 0) {
+ fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump internal node\n");
+ fprintf(stderr, "v2 B-tree internal node usage:\n");
+ fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records>\n");
+ HDexit(4);
+ } /* end if */
+
switch(subtype) {
case H5B2_TEST_ID:
status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2);
@@ -222,6 +253,14 @@ main(int argc, char *argv[])
*/
H5B2_subid_t subtype = (H5B2_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
+ /* Check for enough valid parameters */
+ if(extra == 0 || extra2 == 0) {
+ fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n");
+ fprintf(stderr, "v2 B-tree leaf node usage:\n");
+ fprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n");
+ HDexit(4);
+ } /* end if */
+
switch(subtype) {
case H5B2_TEST_ID:
status = H5B2_leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2);
@@ -242,8 +281,32 @@ main(int argc, char *argv[])
/*
* Debug a fractal heap direct block.
*/
+
+ /* Check for enough valid parameters */
+ if(extra == 0 || extra2 == 0) {
+ fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n");
+ fprintf(stderr, "Fractal heap direct block usage:\n");
+ fprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n");
+ HDexit(4);
+ } /* end if */
+
status = H5HF_dblock_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra, (size_t)extra2);
+ } else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, H5HF_SIZEOF_MAGIC)) {
+ /*
+ * Debug a fractal heap indirect block.
+ */
+
+ /* Check for enough valid parameters */
+ if(extra == 0 || extra2 == 0) {
+ fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n");
+ fprintf(stderr, "Fractal heap indirect block usage:\n");
+ fprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <number of rows>\n");
+ HDexit(4);
+ } /* end if */
+
+ status = H5HF_iblock_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra, (unsigned)extra2);
+
} else if(sig[0] == H5O_VERSION) {
/*
* This could be an object header. Since they don't have a signature