Fix google breakpad for standalone.
The normal usage is to include the src/ directory of google breakpad in your application and then include client/ARCH/handler/exception_handler.h where ARCH is windows, mac or linux. However, Linden Lab for some reason packaged the breakpad prebuilt with exception_handler.h installed in ../google_breakpad/exception_handler.h where "../google_breakpad" is the 'root' of the include tree comparable with 'src' in the source tree of google breakpad. Hence, instead of including 'src' one now must include '../include/google_breakpad' which was already done correctly for non-standable, but not for standalone (BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR was set to '../include' with the 'google_breakpad' and is subsequently never used: instead BREAKPAD_INCLUDE_DIRECTORIES is used (which is set for non-standalone)). Therefore one much not include "google_breakpad/exception_handler.h", but just "exception_handler.h" or you rely on somehow the directory *below* BREAKPAD_INCLUDE_DIRECTORIES to be part of the include path as well. Finally LL packages the prebuilt if another duplicate minidump_descriptor.h in the include root. Also here including "minidump_descriptor.h" would be better correct, but following the instructions by Google this time we might as well include the original "client/linux/handler/minidump_descriptor.h". My repo (http://github.com/AlericInglewood/3p-google-breakpad) doesn't even put minidump_descriptor.h in the root anymore, only exception_handler.h. The rest is an exact copy of the 'src' tree with regard to the headers. Tested to compile both standalone and non-standalone.
This commit is contained in:
@@ -3,25 +3,27 @@
|
|||||||
# - Find Google BreakPad
|
# - Find Google BreakPad
|
||||||
# Find the Google BreakPad includes and library
|
# Find the Google BreakPad includes and library
|
||||||
# This module defines
|
# This module defines
|
||||||
# BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR, where to find exception_handler.h, etc.
|
# BREAKPAD_INCLUDE_DIRECTORIES, where to find the Goole BreakPad includes.
|
||||||
# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad.
|
# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad.
|
||||||
# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad.
|
# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad.
|
||||||
# also defined, but not for general use are
|
# also defined, but not for general use are
|
||||||
# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
|
# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
|
||||||
|
|
||||||
FIND_PATH(BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR google_breakpad/exception_handler.h)
|
FIND_PATH(BREAKPAD_INCLUDE_DIRECTORIES common/using_std_string.h PATH_SUFFIXES google_breakpad)
|
||||||
|
|
||||||
|
MESSAGE("BREAKPAD_INCLUDE_DIRECTORIES = \"${BREAKPAD_INCLUDE_DIRECTORIES}\".")
|
||||||
|
|
||||||
SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
|
SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
|
||||||
FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
||||||
NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
|
NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
|
IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||||
SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
|
SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
|
||||||
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES")
|
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES")
|
||||||
ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
|
ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||||
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO")
|
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO")
|
||||||
ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
|
ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||||
|
|
||||||
|
|
||||||
IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||||
@@ -36,5 +38,5 @@ ENDIF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
|||||||
|
|
||||||
MARK_AS_ADVANCED(
|
MARK_AS_ADVANCED(
|
||||||
BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
||||||
BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR
|
BREAKPAD_INCLUDE_DIRECTORIES
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ else (STANDALONE)
|
|||||||
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client crash_generation_server common)
|
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client crash_generation_server common)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
# yes, this does look dumb, no, it's not incorrect
|
# yes, this does look dumb, no, it's not incorrect
|
||||||
#
|
# I think it's incorrect: the second one should go --Aleric
|
||||||
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad/google_breakpad")
|
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad/google_breakpad")
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include "llstl.h" // for DeletePointer()
|
#include "llstl.h" // for DeletePointer()
|
||||||
#include "llstring.h"
|
#include "llstring.h"
|
||||||
#include "lleventtimer.h"
|
#include "lleventtimer.h"
|
||||||
#include "google_breakpad/exception_handler.h"
|
#include "exception_handler.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signal handling
|
// Signal handling
|
||||||
@@ -70,7 +70,7 @@ void setup_signals();
|
|||||||
void default_unix_signal_handler(int signum, siginfo_t *info, void *);
|
void default_unix_signal_handler(int signum, siginfo_t *info, void *);
|
||||||
|
|
||||||
#if LL_LINUX
|
#if LL_LINUX
|
||||||
#include "google_breakpad/minidump_descriptor.h"
|
#include "client/linux/handler/minidump_descriptor.h"
|
||||||
static bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc,
|
static bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc,
|
||||||
void* context,
|
void* context,
|
||||||
bool succeeded);
|
bool succeeded);
|
||||||
|
|||||||
Reference in New Issue
Block a user