/External/Mysql-5.0/include/my_stacktrace.h

http://awoe.googlecode.com/ · C++ Header · 66 lines · 41 code · 11 blank · 14 comment · 10 complexity · 49101c72e93c22367b52d98b1a99fcbe MD5 · raw file

  1. /* Copyright (C) 2000 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. #ifndef _my_stacktrace_h_
  13. #define _my_stacktrace_h_
  14. #include <my_global.h>
  15. #ifdef TARGET_OS_LINUX
  16. #if defined (__x86_64__) || defined (__i386__) || \
  17. (defined(__alpha__) && defined(__GNUC__))
  18. #define HAVE_STACKTRACE 1
  19. #endif
  20. #elif defined(__WIN__)
  21. #define HAVE_STACKTRACE 1
  22. #endif
  23. #if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD)
  24. #undef HAVE_STACKTRACE
  25. #define HAVE_STACKTRACE 1
  26. #endif
  27. #if !defined(__NETWARE__)
  28. #define HAVE_WRITE_CORE
  29. #endif
  30. #if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
  31. HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \
  32. HAVE_WEAK_SYMBOL
  33. #define BACKTRACE_DEMANGLE 1
  34. #endif
  35. C_MODE_START
  36. #if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
  37. void my_init_stacktrace();
  38. void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
  39. void my_safe_print_str(const char* name, const char* val, int max_len);
  40. void my_write_core(int sig);
  41. #if BACKTRACE_DEMANGLE
  42. char *my_demangle(const char *mangled_name, int *status);
  43. #endif
  44. #ifdef __WIN__
  45. void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
  46. #endif
  47. #endif
  48. #ifdef HAVE_WRITE_CORE
  49. void my_write_core(int sig);
  50. #endif
  51. C_MODE_END
  52. #endif /* _my_stacktrace_h_ */