~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/stacktrace.h

  • Committer: Monty Taylor
  • Date: 2008-10-02 01:31:53 UTC
  • mfrom: (398.1.6 codestyle-new)
  • Revision ID: monty@inaugust.com-20081002013153-b097om921cd3j1pn
MergedĀ fromĀ stdint-includes-fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 Sun Microsystems
19
19
 
20
20
#include "global.h"
21
21
 
22
 
#ifdef  __cplusplus
 
22
#ifdef __cplusplus
23
23
extern "C" {
24
24
#endif
25
25
 
28
28
#endif
29
29
 
30
30
#if BACKTRACE_DEMANGLE
31
 
char *my_demangle(const char *mangled_name, int *status);
 
31
  char *my_demangle(const char *mangled_name, int *status);
32
32
#endif
33
33
 
34
 
#ifdef TARGET_OS_LINUX
35
 
#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) || (defined(__alpha__) && defined(__GNUC__)))
 
34
#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) )
36
35
#undef HAVE_STACKTRACE
37
36
#define HAVE_STACKTRACE
38
37
 
39
 
extern char* __bss_start;
40
 
extern char* heap_start;
 
38
  extern char* __bss_start;
 
39
  extern char* heap_start;
41
40
 
42
41
#define init_stacktrace() do {                                 \
43
 
                            heap_start = (char*) &__bss_start; \
44
 
                          } while(0);
45
 
void check_thread_lib(void);
46
 
#endif /* defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */
47
 
#elif defined (__WIN__)
48
 
#define HAVE_STACKTRACE
49
 
extern void set_exception_pointers(EXCEPTION_POINTERS *ep);
50
 
#define init_stacktrace() {}
51
 
#endif
 
42
    heap_start = (char*) &__bss_start; \
 
43
  } while(0);
 
44
  void check_thread_lib(void);
 
45
#endif /* defined (__i386__) */
52
46
 
53
47
#ifdef HAVE_STACKTRACE
54
 
void print_stacktrace(uchar* stack_bottom, ulong thread_stack);
55
 
void safe_print_str(const char* name, const char* val, int max_len);
 
48
  void print_stacktrace(uchar* stack_bottom, ulong thread_stack);
 
49
  void safe_print_str(const char* name, const char* val, int max_len);
56
50
#else
57
51
/* Define empty prototypes for functions that are not implemented */
58
52
#define init_stacktrace() {}
61
55
#endif /* HAVE_STACKTRACE */
62
56
 
63
57
 
64
 
void write_core(int sig);
 
58
  void write_core(int sig);
65
59
 
66
 
#ifdef  __cplusplus
 
60
#ifdef  __cplusplus
67
61
}
68
62
#endif