~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/stacktrace.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-08 04:22:33 UTC
  • mto: (1115.3.4 captain)
  • mto: This revision was merged to the branch mainline in revision 1117.
  • Revision ID: osullivan.padraig@gmail.com-20090808042233-q0z88zc490z3f3r7
Renamed the Command class to be Statement. Renamed the command directory to
statement and also the command header file to statement. Updated various
source files to reflect this renaming.

Show diffs side-by-side

added added

removed removed

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