summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-02-28 20:25:25 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-02-28 20:25:25 (GMT)
commitc6382f50c5744595d3a9ba69a04f76782f3b8672 (patch)
treec53cc31164515c7647eceb3da2dd64e745c426c6 /tools/h5dump/h5dump.c
parent600bcf0dc3bf984c752737385e0a90ffd29feb38 (diff)
downloadhdf5-c6382f50c5744595d3a9ba69a04f76782f3b8672.zip
hdf5-c6382f50c5744595d3a9ba69a04f76782f3b8672.tar.gz
hdf5-c6382f50c5744595d3a9ba69a04f76782f3b8672.tar.bz2
[svn-r20168] BZ2048: Add -E --enable-error-stack option to h5dump.
Tested: local linux, heiwa, windows
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 6b1f576..98bd6c9 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -92,6 +92,7 @@ static int display_fi = FALSE; /*file index */
static int display_ai = TRUE; /*array index */
static int display_escape = FALSE; /*escape non printable characters */
static int display_region = FALSE; /*print region reference data */
+static int enable_error_stack= FALSE; /* re-enable error stack */
/* sort parameters */
static H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */
@@ -386,7 +387,7 @@ struct handler_t {
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char *s_opts = "hnpeyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:R";
+static const char *s_opts = "hnpeyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RE";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "hel", no_arg, 'h' },
@@ -499,6 +500,7 @@ static struct long_options l_opts[] = {
{ "sort_order", require_arg, 'z' },
{ "format", require_arg, 'm' },
{ "region", no_arg, 'R' },
+ { "enable-error-stack", no_arg, 'E' },
{ NULL, 0, '\0' }
};
@@ -661,6 +663,7 @@ usage(const char *prog)
fprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
fprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n");
fprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n");
+ fprintf(stdout, " -E, --enable-error-stack Show all HDF5 error reporting\n");
fprintf(stdout, "\n");
fprintf(stdout, " Subsetting is available by using the following options with a dataset\n");
fprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
@@ -4221,6 +4224,9 @@ end_collect:
}
/** end subsetting parameters **/
+ case 'E':
+ enable_error_stack = TRUE;
+ break;
case 'h':
usage(h5tools_getprogname());
leave(EXIT_SUCCESS);
@@ -4342,12 +4348,14 @@ main(int argc, const char *argv[])
h5tools_init();
hand = parse_command_line(argc, argv);
- if ( bin_output && outfname == NULL )
- {
+ if (bin_output && outfname == NULL) {
error_msg("binary output requires a file name, use -o <filename>\n");
leave(EXIT_FAILURE);
}
+ if (enable_error_stack)
+ H5Eset_auto2(H5E_DEFAULT, func, edata);
+
/* Check for conflicting options */
if (doxml) {
if (!display_all) {