diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2024-03-07 21:04:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 21:04:14 (GMT) |
commit | 577a32fe83a800b170d4fd8e079fbe2774c9396c (patch) | |
tree | 2a75d2ac8b3de2e389ee5cfee86605ab0720b9a4 /src/H5trace.c | |
parent | bc0c42695f7669f64c00c357880b0dfecf30e343 (diff) | |
download | hdf5-577a32fe83a800b170d4fd8e079fbe2774c9396c.zip hdf5-577a32fe83a800b170d4fd8e079fbe2774c9396c.tar.gz hdf5-577a32fe83a800b170d4fd8e079fbe2774c9396c.tar.bz2 |
Fix bin/trace script w/ out params (#4074)
The bin/trace script adds TRACE macros to public API calls in the main
C library. This script had a parsing bug that caused functions that
were annotated with /*out*/, etc. to be labeled as void pointers
instead of typed pointers.
This is mainly a developer feature and not visible to consumers
of the public API.
The bin/trace script now annotates public API calls properly.
Fixes GH #3733
Diffstat (limited to 'src/H5trace.c')
-rw-r--r-- | src/H5trace.c | 58 |
1 files changed, 45 insertions, 13 deletions
diff --git a/src/H5trace.c b/src/H5trace.c index 7657356..86cf92e 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -23,7 +23,7 @@ /* Module Setup */ /****************/ #include "H5module.h" /* This source code file is part of the H5 module */ -#define H5I_FRIEND /*suppress error about including H5Ipkg */ +#define H5I_FRIEND /* Suppress error about including H5Ipkg */ /***********/ /* Headers */ @@ -40,7 +40,7 @@ #include "H5VLprivate.h" /* Virtual Object Layer */ #ifdef H5_HAVE_PARALLEL -/* datatypes of predefined drivers needed by H5_trace() */ +/* Datatypes of predefined drivers needed by H5_trace() */ #include "H5FDmpio.h" #endif /* H5_HAVE_PARALLEL */ @@ -79,7 +79,7 @@ static herr_t H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degr * Function: H5_trace_args_bool * * Purpose: This routine formats an bool and adds the output to - * the refcounted string (RS) argument. + * the refcounted string (RS) argument. * * Return: SUCCEED / FAIL * @@ -104,7 +104,7 @@ H5_trace_args_bool(H5RS_str_t *rs, bool val) * Function: H5_trace_args_cset * * Purpose: This routine formats an H5T_cset_t and adds the output to - * the refcounted string (RS) argument. + * the refcounted string (RS) argument. * * Return: SUCCEED / FAIL * @@ -148,7 +148,7 @@ H5_trace_args_cset(H5RS_str_t *rs, H5T_cset_t cset) default: H5RS_asprintf_cat(rs, "%ld", (long)cset); break; - } /* end switch */ + } return SUCCEED; } /* end H5_trace_args_cset() */ @@ -197,14 +197,14 @@ H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degree) * Function: H5_trace_args * * Purpose: This routine formats a set of function arguments, placing the - * resulting string in the refcounted string (RS) argument. + * resulting string in the refcounted string (RS) argument. * - * The TYPE argument is a string which gives the type of each of + * The TYPE argument is a string which gives the type of each of * the following argument pairs. Each type begins with zero or - * more asterisks (one for each level of indirection, although - * some types have one level of indirection already implied) - * followed by either one letter (lower case) or two letters - * (first one uppercase). + * more asterisks (one for each level of indirection, although + * some types have one level of indirection already implied) + * followed by either one letter (lower case) or two letters + * (first one uppercase). * * The variable argument list consists of pairs of values. Each * pair is a string which is the formal argument name in the @@ -1480,8 +1480,40 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) H5G_iterate_t git = (H5G_iterate_t)va_arg(ap, H5G_iterate_t); H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)git); - } /* end block */ - break; + } break; + + case 'I': /* H5G_info_t */ + { + H5G_info_t ginfo = va_arg(ap, H5G_info_t); + + H5RS_acat(rs, "{"); + switch (ginfo.storage_type) { + case H5G_STORAGE_TYPE_UNKNOWN: + H5RS_asprintf_cat(rs, "H5G_STORAGE_TYPE_UNKNOWN"); + break; + + case H5G_STORAGE_TYPE_SYMBOL_TABLE: + H5RS_asprintf_cat(rs, "H5G_STORAGE_TYPE_SYMBOL_TABLE"); + break; + + case H5G_STORAGE_TYPE_COMPACT: + H5RS_asprintf_cat(rs, "H5G_STORAGE_TYPE_COMPACT"); + break; + + case H5G_STORAGE_TYPE_DENSE: + H5RS_asprintf_cat(rs, "H5G_STORAGE_TYPE_DENSE"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)ginfo.storage_type); + break; + } + H5RS_asprintf_cat(rs, ", "); + H5RS_asprintf_cat(rs, "%" PRIuHSIZE ", ", ginfo.nlinks); + H5RS_asprintf_cat(rs, "%" PRId64 ", ", ginfo.max_corder); + H5_trace_args_bool(rs, ginfo.mounted); + H5RS_asprintf_cat(rs, "}"); + } break; case 'o': /* H5G_obj_t */ { |