~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/stacktrace.h

Merged remove-dead-find_field_in_table_sef into remove-dead-Item-save_in_field_no_warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <string.h>
24
24
 
25
 
#ifdef __cplusplus
26
 
extern "C" {
27
 
#endif
 
25
#ifdef TARGET_OS_LINUX
 
26
#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) )
 
27
extern char* __bss_start;
 
28
#endif
 
29
#endif
 
30
 
 
31
namespace drizzled
 
32
{
28
33
 
29
34
#if defined(HAVE_BACKTRACE) && HAVE_BACKTRACE_SYMBOLS && HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE
30
35
#define BACKTRACE_DEMANGLE 1
31
36
#endif
32
37
 
33
38
#if defined(BACKTRACE_DEMANGLE)
34
 
  char *my_demangle(const char *mangled_name, int *status);
 
39
extern "C" char *my_demangle(const char *mangled_name, int *status);
35
40
#endif
36
41
 
37
42
#ifdef TARGET_OS_LINUX
39
44
#undef HAVE_STACKTRACE
40
45
#define HAVE_STACKTRACE
41
46
 
42
 
  extern char* __bss_start;
43
 
  extern char* heap_start;
 
47
extern char* heap_start;
44
48
 
45
49
#define init_stacktrace() do {                                 \
46
50
    heap_start = (char*) &__bss_start; \
47
51
  } while(0);
48
 
  void check_thread_lib(void);
 
52
void check_thread_lib(void);
49
53
#endif /* defined (__i386__) */
50
54
#endif /* defined HAVE_OS_LINUX */
51
55
 
52
56
#ifdef HAVE_STACKTRACE
53
 
  void print_stacktrace(unsigned char* stack_bottom, size_t thread_stack);
54
 
  void safe_print_str(const char* name, const char* val, int max_len);
 
57
void print_stacktrace(unsigned char* stack_bottom, size_t thread_stack);
 
58
void safe_print_str(const char* name, const char* val, int max_len);
55
59
#else
56
60
/* Define empty prototypes for functions that are not implemented */
57
61
#define init_stacktrace() {}
60
64
#endif /* HAVE_STACKTRACE */
61
65
 
62
66
 
63
 
  void write_core(int sig);
 
67
void write_core(int sig);
64
68
 
65
 
#ifdef  __cplusplus
66
 
}
67
 
#endif
 
69
} /* namespace drizzled */
68
70
 
69
71
#endif /* DRIZZLED_STACKTRACE_H */