summaryrefslogtreecommitdiffstats
path: root/src/H5HFdbg.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-08-22 03:08:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-08-22 03:08:43 (GMT)
commitde324a50f8e5cc2e07595232dc33908e6560d490 (patch)
tree398e4df5c250cccba28d06ddfb0443a1d6c71b42 /src/H5HFdbg.c
parentab7d724ffd5749c1e3666fd1be0b92f41613af1e (diff)
downloadhdf5-de324a50f8e5cc2e07595232dc33908e6560d490.zip
hdf5-de324a50f8e5cc2e07595232dc33908e6560d490.tar.gz
hdf5-de324a50f8e5cc2e07595232dc33908e6560d490.tar.bz2
[svn-r27549] Description:
Update the file format debugging routines to match the recent changes to the metadata cache, along with a few other cleanups and miscellaneous enhancements. Tested on: MacOSX/64 10.10.5 (amazon) (h5committest forthcoming)
Diffstat (limited to 'src/H5HFdbg.c')
-rw-r--r--src/H5HFdbg.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index 5183b67..736b98d 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -100,6 +100,80 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream,
/*-------------------------------------------------------------------------
+ * Function: H5HF_id_print
+ *
+ * Purpose: Prints a fractal heap ID.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Aug 20 2015
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, const void *_id, FILE *stream, int indent, int fwidth)
+{
+ const uint8_t *id = (const uint8_t *)_id; /* Object ID */
+ uint8_t id_flags; /* Heap ID flag bits */
+ hsize_t obj_off; /* Offset of object */
+ size_t obj_len; /* Length of object */
+ char id_type; /* Character for the type of heap ID */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /*
+ * Check arguments.
+ */
+ HDassert(fh);
+ HDassert(id);
+ HDassert(stream);
+ HDassert(indent >= 0);
+ HDassert(fwidth >= 0);
+
+ /* Get the ID flags */
+ id_flags = *id;
+
+ /* Check for correct heap ID version */
+ if((id_flags & H5HF_ID_VERS_MASK) != H5HF_ID_VERS_CURR)
+ HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "incorrect heap ID version")
+
+ /* Check type of object in heap */
+ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) {
+ id_type = 'M';
+ } /* end if */
+ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) {
+ id_type = 'H';
+ } /* end if */
+ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) {
+ id_type = 'T';
+ } /* end if */
+ else {
+HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
+ } /* end else */
+
+ /* Get the length of the heap object */
+ if(H5HF_get_obj_len(fh, dxpl_id, id, &obj_len) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length")
+
+ /* Get the offset of the heap object */
+ if(H5HF_get_obj_off(fh, dxpl_id, id, &obj_off) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length")
+
+ /* Display the heap ID */
+ HDfprintf(stream, "%*s%-*s (%c, %Hu, %Zu)\n", indent, "", fwidth,
+ "Heap ID info: (type, offset, length)",
+ id_type, obj_off, obj_len);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HF_id_print() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5HF_dtable_debug
*
* Purpose: Prints debugging info about a doubling table