mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Fix defines for inline stack backtraces (only used by developers anyway)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -38,7 +38,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef STACK_BACKTRACES
|
#if ((defined(AST_DEVMODE)) && (defined(Linux)))
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#define MAX_BACKTRACE_FRAMES 20
|
#define MAX_BACKTRACE_FRAMES 20
|
||||||
#endif
|
#endif
|
||||||
@@ -819,7 +819,8 @@ void ast_log(int level, const char *file, int line, const char *function, const
|
|||||||
|
|
||||||
void ast_backtrace(void)
|
void ast_backtrace(void)
|
||||||
{
|
{
|
||||||
#ifdef STACK_BACKTRACES
|
#ifdef Linux
|
||||||
|
#ifdef AST_DEVMODE
|
||||||
int count=0, i=0;
|
int count=0, i=0;
|
||||||
void **addresses;
|
void **addresses;
|
||||||
char **strings;
|
char **strings;
|
||||||
@@ -838,11 +839,10 @@ void ast_backtrace(void)
|
|||||||
free(addresses);
|
free(addresses);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef Linux
|
ast_log(LOG_WARNING, "Must run configure with '--enable-dev-mode' for stack backtraces.\n");
|
||||||
ast_log(LOG_WARNING, "Must compile with 'make dont-optimize' for stack backtraces\n");
|
|
||||||
#else
|
|
||||||
ast_log(LOG_WARNING, "Inline stack backtraces are only available on the Linux platform.\n");
|
|
||||||
#endif
|
#endif
|
||||||
|
#else /* ndef Linux */
|
||||||
|
ast_log(LOG_WARNING, "Inline stack backtraces are only available on the Linux platform.\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user