summaryrefslogtreecommitdiffstats
path: root/src/H5Gent.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-03-22 14:53:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-03-22 14:53:27 (GMT)
commit06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff (patch)
tree3174dcbf8cd52657fa66fd361f2baa9040d4ec14 /src/H5Gent.c
parentb6f34ab3e50a455e8be4700c018404afa1adce26 (diff)
downloadhdf5-06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff.zip
hdf5-06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff.tar.gz
hdf5-06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff.tar.bz2
[svn-r6519] Purpose:
Bug fix/code cleanup/new feature Description: Fix h5debug to work correctly again, with all the changes over the past few months. Improved and cleaned up debugging output available in h5debug. Platforms tested: FreeBSD 4.7 (sleipnir)
Diffstat (limited to 'src/H5Gent.c')
-rw-r--r--src/H5Gent.c71
1 files changed, 40 insertions, 31 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 60ad89b..ab505fb 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -434,10 +434,15 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str
int indent, int fwidth, haddr_t heap)
{
const char *lval = NULL;
+ int nested_indent, nested_fwidth;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5G_ent_debug, FAIL);
+ /* Calculate the indent & field width values for nested information */
+ nested_indent=indent+3;
+ nested_fwidth=MAX(0,fwidth-3);
+
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
"Name offset into private heap:",
(unsigned long) (ent->name_off));
@@ -449,38 +454,42 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str
"Dirty:",
ent->dirty ? "Yes" : "No");
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth,
- "Symbol type:");
+ "Cache info type:");
switch (ent->type) {
- case H5G_NOTHING_CACHED:
- HDfprintf(stream, "Nothing Cached\n");
- break;
-
- case H5G_CACHED_STAB:
- HDfprintf(stream, "Symbol Table\n");
-
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "B-tree address:", ent->cache.stab.btree_addr);
-
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Heap address:", ent->cache.stab.heap_addr);
- break;
-
- case H5G_CACHED_SLINK:
- HDfprintf (stream, "Symbolic Link\n");
- HDfprintf (stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Link value offset:",
- (unsigned long)(ent->cache.slink.lval_offset));
- if (H5F_addr_defined(heap)) {
- lval = H5HL_peek (ent->file, dxpl_id, heap, ent->cache.slink.lval_offset);
- HDfprintf (stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Link value:",
- lval);
- }
- break;
-
- default:
- HDfprintf(stream, "*** Unknown symbol type %d\n", ent->type);
- break;
+ case H5G_NOTHING_CACHED:
+ HDfprintf(stream, "Nothing Cached\n");
+ break;
+
+ case H5G_CACHED_STAB:
+ HDfprintf(stream, "Symbol Table\n");
+
+ HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth,
+ "Cached entry information:");
+ HDfprintf(stream, "%*s%-*s %a\n", nested_indent, "", nested_fwidth,
+ "B-tree address:", ent->cache.stab.btree_addr);
+
+ HDfprintf(stream, "%*s%-*s %a\n", nested_indent, "", nested_fwidth,
+ "Heap address:", ent->cache.stab.heap_addr);
+ break;
+
+ case H5G_CACHED_SLINK:
+ HDfprintf (stream, "Symbolic Link\n");
+ HDfprintf(stream, "%*s%-*s ", indent, "", fwidth,
+ "Cached information:\n");
+ HDfprintf (stream, "%*s%-*s %lu\n", nested_indent, "", nested_fwidth,
+ "Link value offset:",
+ (unsigned long)(ent->cache.slink.lval_offset));
+ if (H5F_addr_defined(heap)) {
+ lval = H5HL_peek (ent->file, dxpl_id, heap, ent->cache.slink.lval_offset);
+ HDfprintf (stream, "%*s%-*s %s\n", nested_indent, "", nested_fwidth,
+ "Link value:",
+ lval);
+ }
+ break;
+
+ default:
+ HDfprintf(stream, "*** Unknown symbol type %d\n", ent->type);
+ break;
}
done: