mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-23 16:59:54 +08:00
Merge pull request #2789 from DennisHeimbigner/execinfo.dmh
Remove the execinfo capability
This commit is contained in:
commit
d7b6ad0b65
@ -7,6 +7,8 @@ This file contains a high-level description of this package's evolution. Release
|
||||
|
||||
## 4.9.3 - TBD
|
||||
|
||||
|
||||
* Remove the use of execinfo to programmatically dump the stack; it never worked. See [Github #2789](https://github.com/Unidata/netcdf-c/pull/2789).
|
||||
* Update the internal copy of tinyxml2 to latest code. See [Github #2771](https://github.com/Unidata/netcdf-c/pull/2771).
|
||||
* Mitigate the problem of remote/nczarr-related test interference. See [Github #2755](https://github.com/Unidata/netcdf-c/pull/2755).
|
||||
* Fix DAP2 proxy problems. See [Github #2764](https://github.com/Unidata/netcdf-c/pull/2764).
|
||||
|
@ -462,9 +462,6 @@ with zip */
|
||||
/* if true, HDF5 is at least version 1.10.5 and supports UTF8 paths */
|
||||
#cmakedefine HDF5_UTF8_PATHS 1
|
||||
|
||||
/* if true, backtrace support will be used. */
|
||||
#cmakedefine HAVE_EXECINFO_H 1
|
||||
|
||||
/* if true, include JNA bug fix */
|
||||
#cmakedefine JNA 1
|
||||
|
||||
|
@ -1312,9 +1312,6 @@ AC_CHECK_HEADERS([sys/resource.h])
|
||||
# See if we have ftw.h to walk directory trees
|
||||
AC_CHECK_HEADERS([ftw.h])
|
||||
|
||||
# See if we can do stack tracing programmatically
|
||||
AC_CHECK_HEADERS([execinfo.h])
|
||||
|
||||
# Check for these functions...
|
||||
AC_CHECK_FUNCS([strlcat snprintf strcasecmp fileno \
|
||||
strdup strtoll strtoull \
|
||||
|
@ -21,10 +21,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
#include "netcdf.h"
|
||||
#include "nclog.h"
|
||||
|
||||
@ -278,10 +274,6 @@ ncuntrace(const char* fcn, int err, const char* fmt, ...)
|
||||
vfprintf(nclog_global.nclogstream, fmt, args);
|
||||
fprintf(nclog_global.nclogstream, "\n" );
|
||||
fflush(nclog_global.nclogstream);
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
if(err != 0)
|
||||
ncbacktrace();
|
||||
#endif
|
||||
}
|
||||
done:
|
||||
va_end(args);
|
||||
@ -304,28 +296,4 @@ ncbreakpoint(int err)
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
#define MAXSTACKDEPTH 100
|
||||
void
|
||||
ncbacktrace(void)
|
||||
{
|
||||
int j, nptrs;
|
||||
void* buffer[MAXSTACKDEPTH];
|
||||
char **strings;
|
||||
|
||||
if(getenv("NCBACKTRACE") == NULL) return;
|
||||
nptrs = backtrace(buffer, MAXSTACKDEPTH);
|
||||
strings = backtrace_symbols(buffer, nptrs);
|
||||
if (strings == NULL) {
|
||||
perror("backtrace_symbols");
|
||||
errno = 0;
|
||||
return;
|
||||
}
|
||||
fprintf(stderr,"Backtrace:\n");
|
||||
for(j = 0; j < nptrs; j++)
|
||||
fprintf(stderr,"%s\n", strings[j]);
|
||||
free(strings);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**@}*/
|
||||
|
@ -14,37 +14,9 @@
|
||||
|
||||
#ifdef H5CATCH
|
||||
|
||||
#define STSIZE 1000
|
||||
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
#ifdef H5BACKTRACE
|
||||
# if !defined _WIN32 && !defined __CYGWIN__
|
||||
static void* stacktrace[STSIZE];
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int
|
||||
nch5breakpoint(int err)
|
||||
{
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
#ifdef H5BACKTRACE
|
||||
# if !defined _WIN32 && !defined __CYGWIN__
|
||||
int count = 0;
|
||||
char** trace = NULL;
|
||||
int i;
|
||||
|
||||
count = backtrace(stacktrace,STSIZE);
|
||||
trace = backtrace_symbols(stacktrace, STSIZE);
|
||||
fprintf(stderr,"backtrace:\n");
|
||||
for(i=0;i<count;i++)
|
||||
fprintf(stderr,"[%03d] %s\n",i,trace[i]);
|
||||
# if 0
|
||||
if(trace != NULL) free(trace);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
return ncbreakpoint(err);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user