]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixes to get ast_backtrace working properly. The AST_DEVMODE macro was never defined...
authorMark Michelson <mmichelson@digium.com>
Thu, 26 Jul 2007 20:35:17 +0000 (20:35 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 26 Jul 2007 20:35:17 +0000 (20:35 +0000)
attempted compilation. The makefile now defines AST_DEVMODE if configure was run with --enable-dev-mode. Also, changes were
made to acccomodate 64 bit systems in ast_backtrace.

Thanks to qwell, kpfleming, and Corydon76 for their roles in allowing me to get this committed

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77380 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
main/logger.c

index fb8466a35bdc6e4a3ecae89dc12a1ebdc9ddd7bf..a5d8eae86616abb0c4f0117b5889d4ba98fd3ac3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -192,7 +192,7 @@ ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declar
 ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
 
 ifeq ($(AST_DEVMODE),yes)
-  ASTCFLAGS+=-Werror  -Wunused $(AST_DECLARATION_AFTER_STATEMENT)
+  ASTCFLAGS+=-Werror  -Wunused $(AST_DECLARATION_AFTER_STATEMENT) -DAST_DEVMODE
 endif
 
 ifneq ($(findstring BSD,$(OSARCH)),)
index 3f0e3758324822c8d92de89663e4a288385c1078..50d8ca1ab282b39bf1c1b5b6ff1a35dc06968718 100644 (file)
@@ -830,7 +830,11 @@ void ast_backtrace(void)
                if ((strings = backtrace_symbols(addresses, count))) {
                        ast_log(LOG_DEBUG, "Got %d backtrace record%c\n", count, count != 1 ? 's' : ' ');
                        for (i=0; i < count ; i++) {
+#if __WORDSIZE == 32
                                ast_log(LOG_DEBUG, "#%d: [%08X] %s\n", i, (unsigned int)addresses[i], strings[i]);
+#elif __WORDSIZE == 64
+                               ast_log(LOG_DEBUG, "#%d: [%016lX] %s\n", i, (unsigned long)addresses[i], strings[i]);
+#endif
                        }
                        free(strings);
                } else {