~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/stacktrace.h

  • Committer: Monty Taylor
  • Date: 2010-02-04 08:14:46 UTC
  • mfrom: (1277.2.1 build) (1280.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1283.
  • Revision ID: mordred@inaugust.com-20100204081446-ldh9m486va30uap6
Put everything in drizzled into drizzled namespace.
Put internal stuff into drizzled::internal namespace.
Removed some cruft.
Now every symbol that is shipped in a header is in the drizzled namespace
and everything in the server that's not shipped is labeled internal. woot. 
Removed a lot of the extra extern "C" stuff that was in there. Less ugliness for
internal callbacks now for Sun Studio.

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 */