[asterisk-commits] tilghman: branch tilghman/better_backtrace_1.4 r298053 - in /team/tilghman/be...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 10 10:51:02 CST 2010


Author: tilghman
Date: Fri Dec 10 10:50:58 2010
New Revision: 298053

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=298053
Log:
Disable by default.  Also, fix an issue found by Mark Michelson.

Modified:
    team/tilghman/better_backtrace_1.4/build_tools/cflags-devmode.xml
    team/tilghman/better_backtrace_1.4/main/Makefile
    team/tilghman/better_backtrace_1.4/main/logger.c

Modified: team/tilghman/better_backtrace_1.4/build_tools/cflags-devmode.xml
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/better_backtrace_1.4/build_tools/cflags-devmode.xml?view=diff&rev=298053&r1=298052&r2=298053
==============================================================================
--- team/tilghman/better_backtrace_1.4/build_tools/cflags-devmode.xml (original)
+++ team/tilghman/better_backtrace_1.4/build_tools/cflags-devmode.xml Fri Dec 10 10:50:58 2010
@@ -14,4 +14,8 @@
 		</member>
 		<member name="TEST_FRAMEWORK" displayname="Enable Test Framework API">
 		</member>
+		<member name="BETTER_BACKTRACES" displayname="Use libbfd to generate better inline backtraces">
+			<depend>BFD</depend>
+			<defaultenabled>no</defaultenabled>
+		</member>
 	</category>

Modified: team/tilghman/better_backtrace_1.4/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/better_backtrace_1.4/main/Makefile?view=diff&rev=298053&r1=298052&r2=298053
==============================================================================
--- team/tilghman/better_backtrace_1.4/main/Makefile (original)
+++ team/tilghman/better_backtrace_1.4/main/Makefile Fri Dec 10 10:50:58 2010
@@ -50,7 +50,7 @@
   AST_LIBS+=$(EDITLINE_LIB) -lm
 endif
 
-ifneq ($(BFD_LIB),)
+ifneq ($(findstring BETTER_BACKTRACES,$(MENUSELECT_CFLAGS)),)
   AST_LIBS+=$(BFD_LIB)
 endif
 

Modified: team/tilghman/better_backtrace_1.4/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/better_backtrace_1.4/main/logger.c?view=diff&rev=298053&r1=298052&r2=298053
==============================================================================
--- team/tilghman/better_backtrace_1.4/main/logger.c (original)
+++ team/tilghman/better_backtrace_1.4/main/logger.c Fri Dec 10 10:50:58 2010
@@ -41,7 +41,7 @@
 #if ((defined(AST_DEVMODE)) && (defined(linux)))
 #  include <execinfo.h>
 #  define MAX_BACKTRACE_FRAMES 20
-#  if defined(HAVE_DLADDR) && defined(HAVE_BFD)
+#  if defined(HAVE_DLADDR) && defined(HAVE_BFD) && defined(BETTER_BACKTRACES)
 #    include <dlfcn.h>
 #    include <bfd.h>
 #  endif
@@ -836,7 +836,7 @@
 #  ifdef AST_DEVMODE
 	int stackcount = 0, stackfr;
 	void **addresses;
-#    if defined(HAVE_DLADDR) && defined(HAVE_BFD)
+#    if defined(HAVE_DLADDR) && defined(HAVE_BFD) && defined(BETTER_BACKTRACES)
 	bfd *bfdobj;           /* bfd.h */
 	Dl_info dli;           /* dlfcn.h */
 	long allocsize;
@@ -853,7 +853,7 @@
 
 	if ((addresses = ast_calloc(MAX_BACKTRACE_FRAMES, sizeof(*addresses)))) {
 		stackcount = backtrace(addresses, MAX_BACKTRACE_FRAMES);
-#    if defined(HAVE_DLADDR) && defined(HAVE_BFD)
+#    if defined(HAVE_DLADDR) && defined(HAVE_BFD) && defined(BETTER_BACKTRACES)
 		ast_log(LOG_DEBUG, "Got %d backtrace record%c\n", stackcount, stackcount != 1 ? 's' : ' ');
 		for (stackfr = 0; stackfr < stackcount; stackfr++) {
 			int found = 0, symbolcount;
@@ -967,21 +967,21 @@
 #      endif
 			}
 		}
-#    else /* !defined(HAVE_DLADDR) || !defined(HAVE_BFD) */
+#    else /* !defined(HAVE_DLADDR) || !defined(HAVE_BFD) || !defined(BETTER_BACKTRACES) */
 		if ((strings = backtrace_symbols(addresses, stackcount))) {
 			ast_log(LOG_DEBUG, "Got %d backtrace record%c\n", stackcount, stackcount != 1 ? 's' : ' ');
 			for (stackfr = 0; stackfr < stackcount ; stackfr++) {
 #      if __WORDSIZE == 32
-				ast_log(LOG_DEBUG, "#%d: [%08X] %s\n", i, (unsigned int)addresses[stackfr], strings[stackfr]);
+				ast_log(LOG_DEBUG, "#%d: [%08X] %s\n", stackfr, (unsigned int)addresses[stackfr], strings[stackfr]);
 #      elif __WORDSIZE == 64
-				ast_log(LOG_DEBUG, "#%d: [%016lX] %s\n", i, (unsigned long)addresses[stackfr], strings[stackfr]);
+				ast_log(LOG_DEBUG, "#%d: [%016lX] %s\n", stackfr, (unsigned long)addresses[stackfr], strings[stackfr]);
 #      endif
 			}
 			free(strings);
 		} else {
 			ast_log(LOG_DEBUG, "Could not allocate memory for backtrace\n");
 		}
-#    endif /* defined(HAVE_DLADDR) && defined(HAVE_BFD) */
+#    endif /* defined(HAVE_DLADDR) && defined(HAVE_BFD) && defined(BETTER_BACKTRACES) */
 		free(addresses);
 	}
 #  else /* !defined(AST_DEVMODE) */




More information about the asterisk-commits mailing list