PageRenderTime 27ms CodeModel.GetById 15ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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