Kaydet (Commit) f4680be8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

HAVE_FEATURE_CRASHDUMP instead of manual SAL_ENABLE_CRASH_REPORT

Change-Id: Ifaf971d77f11cef207706989bba11dbe2028ca79
üst b736204f
...@@ -146,4 +146,7 @@ ...@@ -146,4 +146,7 @@
*/ */
#define HAVE_FEATURE_COLLADA 0 #define HAVE_FEATURE_COLLADA 0
/* see --enable-crashdump: */
#define HAVE_FEATURE_CRASHDUMP 0
#endif #endif
...@@ -4537,6 +4537,7 @@ if test "$enable_crashdump" = "yes"; then ...@@ -4537,6 +4537,7 @@ if test "$enable_crashdump" = "yes"; then
ENABLE_CRASHDUMP="TRUE" ENABLE_CRASHDUMP="TRUE"
BUILD_TYPE="$BUILD_TYPE CRASHREP" BUILD_TYPE="$BUILD_TYPE CRASHREP"
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_FEATURE_CRASHDUMP)
else else
ENABLE_CRASHDUMP="" ENABLE_CRASHDUMP=""
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
......
...@@ -176,8 +176,8 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ ...@@ -176,8 +176,8 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/unx/time \ sal/osl/unx/time \
$(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \
)) ))
$(eval $(call gb_Library_add_cobject,sal,sal/osl/unx/signal, \ $(eval $(call gb_Library_add_cobjects,sal, \
$(if $(ENABLE_CRASHDUMP),-DSAL_ENABLE_CRASH_REPORT) \ sal/osl/unx/signal \
)) ))
# Note that the uunxapi.mm file just includes the uunxapi.cxx one # Note that the uunxapi.mm file just includes the uunxapi.cxx one
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include <config_features.h>
/* system headers */ /* system headers */
#include "system.h" #include "system.h"
...@@ -25,7 +29,7 @@ ...@@ -25,7 +29,7 @@
#if defined( INTEL ) #if defined( INTEL )
#include "backtrace.h" #include "backtrace.h"
#define INCLUDE_BACKTRACE #define INCLUDE_BACKTRACE
#ifdef SAL_ENABLE_CRASH_REPORT #if HAVE_FEATURE_CRASHDUMP
#define STACKTYPE "MacOsX_X86" #define STACKTYPE "MacOsX_X86"
#endif #endif
#endif /* INTEL */ #endif /* INTEL */
...@@ -36,7 +40,7 @@ ...@@ -36,7 +40,7 @@
#include <execinfo.h> #include <execinfo.h>
#include <link.h> #include <link.h>
#define INCLUDE_BACKTRACE #define INCLUDE_BACKTRACE
#if defined SAL_ENABLE_CRASH_REPORT #if HAVE_FEATURE_CRASHDUMP
#define STACKTYPE "Linux" #define STACKTYPE "Linux"
#endif #endif
#endif #endif
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
#include "backtrace.h" #include "backtrace.h"
#define INCLUDE_BACKTRACE #define INCLUDE_BACKTRACE
#if defined SAL_ENABLE_CRASH_REPORT #if HAVE_FEATURE_CRASHDUMP
#if defined( SPARC ) #if defined( SPARC )
#define STACKTYPE "Solaris_Sparc" #define STACKTYPE "Solaris_Sparc"
#elif defined( INTEL ) #elif defined( INTEL )
...@@ -77,7 +81,7 @@ ...@@ -77,7 +81,7 @@
#define ACT_EXIT 2 #define ACT_EXIT 2
#define ACT_SYSTEM 3 #define ACT_SYSTEM 3
#define ACT_HIDE 4 #define ACT_HIDE 4
#ifdef SAL_ENABLE_CRASH_REPORT #if HAVE_FEATURE_CRASHDUMP
# define ACT_ABORT 5 # define ACT_ABORT 5
#else #else
# define ACT_ABORT ACT_SYSTEM # define ACT_ABORT ACT_SYSTEM
...@@ -310,7 +314,7 @@ static sal_Bool DeInitSignal(void) ...@@ -310,7 +314,7 @@ static sal_Bool DeInitSignal(void)
return sal_False; return sal_False;
} }
#if defined (SAL_ENABLE_CRASH_REPORT) && defined(INCLUDE_BACKTRACE) #if HAVE_FEATURE_CRASHDUMP && defined(INCLUDE_BACKTRACE)
static sal_uInt32 calc_md5_checksum( const char *filename, sal_uInt8 *pChecksum, sal_uInt32 nChecksumLen ) static sal_uInt32 calc_md5_checksum( const char *filename, sal_uInt8 *pChecksum, sal_uInt32 nChecksumLen )
{ {
...@@ -389,8 +393,7 @@ static int fputs_xml( const char *string, FILE *stream ) ...@@ -389,8 +393,7 @@ static int fputs_xml( const char *string, FILE *stream )
/* Create intermediate files and run crash reporter */ /* Create intermediate files and run crash reporter */
#if defined SAL_ENABLE_CRASH_REPORT && defined INCLUDE_BACKTRACE && \ #if HAVE_FEATURE_CRASHDUMP && defined INCLUDE_BACKTRACE && defined LINUX
defined LINUX
typedef struct typedef struct
{ {
...@@ -473,7 +476,7 @@ dynamic_section_offset(const char *name) ...@@ -473,7 +476,7 @@ dynamic_section_offset(const char *name)
static int ReportCrash( int Signal ) static int ReportCrash( int Signal )
{ {
#ifdef SAL_ENABLE_CRASH_REPORT #if HAVE_FEATURE_CRASHDUMP
#define REPORTENV_PARAM "-crashreportenv:" #define REPORTENV_PARAM "-crashreportenv:"
...@@ -794,12 +797,12 @@ static int ReportCrash( int Signal ) ...@@ -794,12 +797,12 @@ static int ReportCrash( int Signal )
} }
return 1; return 1;
#else /* defined SAL_ENABLE_CRASH_REPORT */ #else /* HAVE_FEATURE_CRASHDUMP */
/* the utility crash_report is not build, so do the same as when /* the utility crash_report is not build, so do the same as when
the option -nocrashreport is used */ the option -nocrashreport is used */
(void) Signal; // avoid warnings (void) Signal; // avoid warnings
return -1; return -1;
#endif /* defined SAL_ENABLE_CRASH_REPORT */ #endif /* HAVE_FEATURE_CRASHDUMP */
} }
static void PrintStack( int sig ) static void PrintStack( int sig )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment