Changeset 56bce6 in git


Ignore:
Timestamp:
Jul 27, 2012, 7:02:58 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '96ce329119711a2b80858c8365abd29f8460bbfa')
Children:
6e81fc109b87ebfc796436d4e9472bc3819b5974
Parents:
868735e4d3507b1edcdb4f3879fc5913562b997b
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-27 19:02:58+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-27 19:03:53+02:00
Message:
added autoconf tests for cxxabi.h and execinfo.h in order to use backtrace* and abi::__cxa_demangle
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/configure.ac

    r868735 r56bce6  
    5757AC_HEADER_STDC
    5858AC_STDC_HEADERS
    59 AC_CHECK_HEADERS([stdlib.h string.h unistd.h pwd.h sys/param.h limits.h float.h])
     59AC_CHECK_HEADERS([stdlib.h string.h unistd.h pwd.h sys/param.h limits.h float.h execinfo.h])
     60
     61# If the compiler supports GCC C++ ABI name demangling (has header
     62#   cxxabi.h and abi::__cxa_demangle() function), define
     63#   HAVE_GCC_ABI_DEMANGLE
     64AX_CXX_GCC_ABI_DEMANGLE
    6065
    6166# Checks for typedefs, structures, and compiler characteristics.
  • libpolys/reporter/dError.cc

    r868735 r56bce6  
    2424}
    2525
    26 #define HAVE_EXECINFO
    27 #define HAVE_CXXABI
     26#ifdef HAVE_EXECINFO_H
     27#include <execinfo.h>
     28#endif
    2829
    29 #ifdef HAVE_EXECINFO
    30 #include <execinfo.h>
     30#ifdef HAVE_UNISTD_H
    3131#include <unistd.h>
    3232#endif
    3333
    34 #ifdef HAVE_CXXABI
     34#ifdef HAVE_GCC_ABI_DEMANGLE
    3535#include <cxxabi.h>
    3636#endif
     
    3838
    3939#include <reporter/reporter.h>
     40
    4041#ifdef HAVE_CONFIG_H
    4142#include <omalloc/omalloc.h>
     
    5657int dReportError(const char* fmt, ...)
    5758{
    58 #ifdef HAVE_EXECINFO
     59#ifdef HAVE_EXECINFO_H
    5960#define SIZE 50
    6061  void *buffer[SIZE+1]; int i, j, k, ret, status; char **ptr; char *demangledName; char *s; char *ss;
     
    7475#endif
    7576
    76 #ifdef HAVE_EXECINFO
    77   ret = backtrace( buffer, SIZE );
     77#ifdef HAVE_EXECINFO_H
     78  ret = backtrace( buffer, SIZE ); // execinfo.h
    7879  fprintf(stderr, "\nExecinfo backtrace (with %zd stack frames): \n", ret);
    7980 
    80 #ifndef HAVE_CXXABI
    81   backtrace_symbols_fd(buffer, ret, STDERR_FILENO);
     81#ifndef HAVE_GCC_ABI_DEMANGLE
     82  backtrace_symbols_fd(buffer, ret, STDERR_FILENO); // execinfo.h
    8283#else
    83   ptr = backtrace_symbols( buffer, ret );
     84  ptr = backtrace_symbols( buffer, ret ); // execinfo.h
    8485
    8586  for (i = 0; i < ret; i++)
     
    100101    {
    101102      ss[0] = 0;
    102       demangledName = abi::__cxa_demangle( s, NULL, NULL, &status );
     103      demangledName = abi::__cxa_demangle( s, NULL, NULL, &status ); // cxxabi.h!
    103104      if( status == 0 && demangledName != NULL )
    104105        fprintf (stderr, " '%s'", (demangledName[0] != 0)? demangledName: s);
     
    129130  dErrorBreak();
    130131#else
    131   fprintf(stderr, "\n// !!! YOU HAVE FOUND A BUG IN SINGULAR.");
     132  fprintf(stderr, "\n// !!! YOU HAVE FOUND A BUG IN SINGULAR::Spielwiese.");
    132133  fprintf(stderr, "// !!! Please, email the input\n// and the following error message to singular@mathematik.uni-kl.de")
    133134  vfprintf(stderr, fmt, ap);
Note: See TracChangeset for help on using the changeset viewer.