summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-12-11 21:35:46 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-12-11 21:35:46 (GMT)
commitfaca6fbaa8c557b18d6b264841fc8717d1e73816 (patch)
tree2123e6290a24e6ad94c776e45283800cc6917f92 /src/H5AC.c
parent3c16901751f40fcbbf36878fe13b0237a3753bc9 (diff)
downloadhdf5-faca6fbaa8c557b18d6b264841fc8717d1e73816.zip
hdf5-faca6fbaa8c557b18d6b264841fc8717d1e73816.tar.gz
hdf5-faca6fbaa8c557b18d6b264841fc8717d1e73816.tar.bz2
[svn-r145] ./src/H5Osdtyp.c -> H5Odtype.c
./src/H5Osdim.c -> H5Osdspace.c ./src/Makefile.in Changed the names of these files to better reflect what they actually do. ./src/H5.c ./src/H5AC.c ./src/H5B.c ./src/H5C.c ./src/H5D.c ./src/H5E.c ./src/H5Eprivate.h ./src/H5Epublic.h ./src/H5F.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gshad.c ./src/H5Gstab.c ./src/H5H.c ./src/H5M.c ./src/H5MF.c ./src/H5O.c ./src/H5Osdtyp.c (./src/H5Odtype.c) ./src/H5P.c ./src/H5T.c ./src/H5detect.c ./src/H5private.h Added an argument to the HRETURN_ERROR(), HGOTO_ERROR(), and HERROR() macros which is a string error message. This allows us to give extra information which can't be represented by the major and minor error numbers. This information was previously in comments just before or after the macro call. The string isn't currently used, but I'm planning to change the test files so they print an error trace when something fails. This should make debugging a little faster since it's often obvious what's wrong if we could just see the error stack without even having to start a debugger.
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 19e177e..8a5f4ed 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -112,7 +112,8 @@ H5AC_dest (H5F_t *f)
cache = f->shared->cache;
if (H5AC_flush (f, NULL, NO_ADDR, TRUE)<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL,
+ "unable to flush cache");
}
#ifdef H5AC_DEBUG
@@ -212,7 +213,8 @@ H5AC_find_f (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
* of the wrong type.
*/
if (slot->type && slot->type!=type && H5F_addr_eq (&(slot->addr), addr)) {
- HRETURN_ERROR (H5E_CACHE, H5E_BADTYPE, NULL);
+ HRETURN_ERROR (H5E_CACHE, H5E_BADTYPE, NULL,
+ "internal error (correct address, wrong type)");
}
#ifdef H5AC_DEBUG
@@ -234,7 +236,7 @@ H5AC_find_f (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
* without preempting anything.
*/
if (NULL==(thing=(type->load)(f, addr, udata1, udata2))) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTLOAD, NULL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTLOAD, NULL, "unable to load object");
}
/*
@@ -249,9 +251,11 @@ H5AC_find_f (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
* Release the new thing and fail.
*/
if ((type->flush)(f, TRUE, addr, thing)<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, NULL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, NULL,
+ "unable to flush just-loaded object");
}
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, NULL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, NULL,
+ "unable to flush existing cached object");
}
cache->diagnostics[slot->type->id].nflushes++;
}
@@ -398,7 +402,8 @@ H5AC_flush (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
status = (flush)(f, destroy, &(slot->addr), slot->thing);
if (status<0) {
map = H5MM_xfree (map);
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL,
+ "can't flush cache");
}
cache->diagnostics[slot->type->id].nflushes++;
if (destroy) slot->type = NULL;
@@ -411,7 +416,8 @@ H5AC_flush (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
* else should have been flushed.
*/
if (cache->nprots>0) {
- HRETURN_ERROR (H5E_CACHE, H5E_PROTECT, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_PROTECT, FAIL,
+ "cache has protected items");
}
} else {
@@ -425,7 +431,8 @@ H5AC_flush (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
status = (flush) (f, destroy, &(cache->slot[i].addr),
cache->slot[i].thing);
if (status<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL,
+ "can't flush object");
}
cache->diagnostics[cache->slot[i].type->id].nflushes++;
if (destroy) cache->slot[i].type = NULL;
@@ -492,7 +499,8 @@ H5AC_set (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, void *thing)
flush = slot->type->flush;
status = (flush)(f, TRUE, &(slot->addr), slot->thing);
if (status<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL,
+ "can't flush object");
}
cache->diagnostics[slot->type->id].nflushes++;
}
@@ -582,7 +590,8 @@ H5AC_rename (H5F_t *f, const H5AC_class_t *type,
status = (flush)(f, TRUE, &(cache->slot[new_idx].addr),
cache->slot[new_idx].thing);
if (status<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL,
+ "can't flush object");
}
cache->diagnostics[cache->slot[new_idx].type->id].nflushes++;
}
@@ -668,7 +677,8 @@ H5AC_protect (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
/*
* Right address but wrong object type.
*/
- HRETURN_ERROR (H5E_CACHE, H5E_BADTYPE, NULL);
+ HRETURN_ERROR (H5E_CACHE, H5E_BADTYPE, NULL,
+ "internal error");
} else {
#ifdef H5AC_DEBUG
@@ -689,7 +699,8 @@ H5AC_protect (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
*/
cache->diagnostics[type->id].nmisses++;
if (NULL==(thing=(type->load)(f, addr, udata1, udata2))) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTLOAD, NULL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTLOAD, NULL,
+ "can't load object");
}
}
@@ -770,7 +781,8 @@ H5AC_unprotect (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
flush = slot->type->flush;
status = (flush)(f, TRUE, &(slot->addr), slot->thing);
if (status<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
+ HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL,
+ "can't flush object");
}
cache->diagnostics[slot->type->id].nflushes++;
}