diff options
author | beber <beber> | 2005-12-02 10:56:29 +0000 |
---|---|---|
committer | beber <beber> | 2005-12-02 10:56:29 +0000 |
commit | e81fbef07d723955738ab5a6ddb349a72a18f6ff (patch) | |
tree | 790ea49f400819a6fe26d78b245d772c6aceb165 /src/espik_debug.c | |
parent | #e.fr (diff) | |
download | espik-e81fbef07d723955738ab5a6ddb349a72a18f6ff.tar.xz |
Some work on debug
Diffstat (limited to 'src/espik_debug.c')
-rw-r--r-- | src/espik_debug.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/espik_debug.c b/src/espik_debug.c index c6e8a26..0ea9c24 100644 --- a/src/espik_debug.c +++ b/src/espik_debug.c @@ -8,13 +8,15 @@ # include <execinfo.h> #endif /* __GLIBC__ */ -#if _ESPIK_DEBUG +#if _ESPIK_DEBUG_ # include <signal.h> -#endif /* _ESPIK_DEBUG */ +#endif /* _ESPIK_DEBUG_ */ inline void espik_debug_bt (int num) { -#ifdef __GLIBC__ && _ESPIK_DEBUG +#ifdef __GLIBC__ +# if _ESPIK_DEBUG_ + void* array[128]; size_t size; char** strings; @@ -30,16 +32,18 @@ inline void espik_debug_bt (int num) if (strings) free(strings); -#else -# ifndef __GLIBC__ + +# endif /* _ESPIK_DEBUG_ */ +#endif /* __GLIBC__ */ + +#ifndef __GLIBC__ fprintf(stderr, "Your system doesn't have glibc. Backtraces disabled. But program receive signal %d.\n", num); -# endif /* ! __GLIBC__ */ -#endif /* __GLIBC__ && _ESPIK_DEBUG */ +#endif /* __GLIBC__ */ } void espik_debug_init() { -#if _ESPIK_DEBUG +#if _ESPIK_DEBUG_ struct sigaction sa; sa.sa_handler = espik_debug_bt; |