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:
4
4
* Copyright (C) 2008 Sun Microsystems
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);
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
39
extern char* __bss_start;
40
extern char* heap_start;
38
extern char* __bss_start;
39
extern char* heap_start;
42
41
#define init_stacktrace() do { \
43
heap_start = (char*) &__bss_start; \
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() {}
42
heap_start = (char*) &__bss_start; \
44
void check_thread_lib(void);
45
#endif /* defined (__i386__) */
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);
57
51
/* Define empty prototypes for functions that are not implemented */
58
52
#define init_stacktrace() {}