developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame^] | 1 | --- a/source/breakpad_wrapper/breakpad_wrapper.cpp |
| 2 | +++ b/source/breakpad_wrapper/breakpad_wrapper.cpp |
| 3 | @@ -0,0 +1,20 @@ |
| 4 | +#include <client/linux/handler/exception_handler.h> |
| 5 | +// called by 'google_breakpad::ExceptionHandler' on every crash |
| 6 | +namespace |
| 7 | +{ |
| 8 | +bool breakpadCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) |
| 9 | +{ |
| 10 | + (void) descriptor; |
| 11 | + (void) context; |
| 12 | + return succeeded; |
| 13 | +} |
| 14 | +// Instantiate only one 'google_breakpad::ExceptionHandler' |
| 15 | +// - "/opt/minidumps" is canonical path that should be in sync with uploadDumps.sh script |
| 16 | +extern "C" void breakpad_ExceptionHandler() |
| 17 | +{ |
| 18 | + static google_breakpad::ExceptionHandler* excHandler = NULL; |
| 19 | + delete excHandler; |
| 20 | + excHandler = new google_breakpad::ExceptionHandler(google_breakpad::MinidumpDescriptor("/opt/minidumps"), NULL, breakpadCallback, NULL, true, -1); |
| 21 | +} |
| 22 | +} |
| 23 | + |
| 24 | --- a/source/breakpad_wrapper/include/breakpad_wrapper.h |
| 25 | +++ b/source/breakpad_wrapper/include/breakpad_wrapper.h |
| 26 | @@ -0,0 +1,8 @@ |
| 27 | +#ifdef __cplusplus |
| 28 | +extern "C" |
| 29 | +{ |
| 30 | +#endif |
| 31 | +void breakpad_ExceptionHandler(); |
| 32 | +#ifdef __cplusplus |
| 33 | +} |
| 34 | +#endif |
| 35 | --- a/source/Makefile.am |
| 36 | +++ b/source/Makefile.am |
| 37 | @@ -16,4 +16,4 @@ |
| 38 | # See the License for the specific language governing permissions and |
| 39 | # limitations under the License. |
| 40 | ########################################################################## |
| 41 | -SUBDIRS = cosa debug_api ccsp util_api |
| 42 | +SUBDIRS = cosa debug_api ccsp util_api breakpad_wrapper |
| 43 | --- a/source/breakpad_wrapper/Makefile.am |
| 44 | +++ b/source/breakpad_wrapper/Makefile.am |
| 45 | @@ -0,0 +1,8 @@ |
| 46 | +AM_CPPFLAGS = -Wall -Werror |
| 47 | +ACLOCAL_AMFLAGS = -I m4 |
| 48 | +hardware_platform = i686-linux-gnu |
| 49 | + |
| 50 | +noinst_LTLIBRARIES = libCcspCommonLibrary_breakpad_wrapper.la |
| 51 | +libCcspCommonLibrary_breakpad_wrapper_la_CPPFLAGS = $(CPPFLAGS) |
| 52 | +libCcspCommonLibrary_breakpad_wrapper_la_SOURCES = breakpad_wrapper.cpp |
| 53 | +libCcspCommonLibrary_breakpad_wrapper_la_LDFLAGS = -lbreakpad_client |
| 54 | --- a/configure.ac |
| 55 | +++ b/configure.ac |
| 56 | @@ -34,6 +34,7 @@ |
| 57 | |
| 58 | # Checks for programs. |
| 59 | AC_PROG_CC |
| 60 | +AC_PROG_CXX |
| 61 | AC_PROG_INSTALL |
| 62 | AM_PROG_CC_C_O |
| 63 | AM_PROG_LIBTOOL(libtool) |
| 64 | @@ -112,6 +113,7 @@ |
| 65 | source/cosa/package/Makefile |
| 66 | source/cosa/Makefile |
| 67 | source/debug_api/Makefile |
| 68 | + source/breakpad_wrapper/Makefile |
| 69 | source/ccsp/components/common/PoamIrepFolder/Makefile |
| 70 | source/ccsp/components/common/DataModel/dml/components/DslhVarEntity/Makefile |
| 71 | source/ccsp/components/common/DataModel/dml/components/DslhObjController/Makefile |
| 72 | --- a/Makefile.am |
| 73 | +++ b/Makefile.am |
| 74 | @@ -65,6 +65,7 @@ |
| 75 | source/cosa/package/bmc2/components/Bmc2ComTerminal/libCcspCommonLibrary_Bmc2ComTerminal.la \ |
| 76 | source/cosa/package/bmc2/components/Bmc2ComDomain/libCcspCommonLibrary_Bmc2ComDomain.la \ |
| 77 | source/debug_api/libCcspCommonLibrary_debug_api.la \ |
| 78 | + source/breakpad_wrapper/libCcspCommonLibrary_breakpad_wrapper.la \ |
| 79 | source/ccsp/components/common/PoamIrepFolder/libCcspCommonLibrary_PoamIrepFolder.la \ |
| 80 | source/ccsp/components/common/DataModel/dml/components/DslhVarEntity/libCcspCommonLibrary_DslhVarEntity.la \ |
| 81 | source/ccsp/components/common/DataModel/dml/components/DslhObjController/libCcspCommonLibrary_DslhObjController.la \ |