switch to backward-cpp
This commit is contained in:
parent
42b67a7b61
commit
ca799298f4
@ -45,6 +45,7 @@ decmult_gen_prec_bits
|
|||||||
decmult_window_size
|
decmult_window_size
|
||||||
degl
|
degl
|
||||||
denable_threaded_resolver
|
denable_threaded_resolver
|
||||||
|
deps
|
||||||
devent__disable_openssl
|
devent__disable_openssl
|
||||||
devent__disable_tests
|
devent__disable_tests
|
||||||
devent__library_type
|
devent__library_type
|
||||||
|
4496
deps/include/backward.hpp
vendored
Normal file
4496
deps/include/backward.hpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
42
deps/src/backward.cpp
vendored
Normal file
42
deps/src/backward.cpp
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// Pick your poison.
|
||||||
|
//
|
||||||
|
// On GNU/Linux, you have few choices to get the most out of your stack trace.
|
||||||
|
//
|
||||||
|
// By default you get:
|
||||||
|
// - object filename
|
||||||
|
// - function name
|
||||||
|
//
|
||||||
|
// In order to add:
|
||||||
|
// - source filename
|
||||||
|
// - line and column numbers
|
||||||
|
// - source code snippet (assuming the file is accessible)
|
||||||
|
|
||||||
|
// Install one of the following libraries then uncomment one of the macro (or
|
||||||
|
// better, add the detection of the lib and the macro definition in your build
|
||||||
|
// system)
|
||||||
|
|
||||||
|
// - apt-get install libdw-dev ...
|
||||||
|
// - g++/clang++ -ldw ...
|
||||||
|
// #define BACKWARD_HAS_DW 1
|
||||||
|
|
||||||
|
// - apt-get install binutils-dev ...
|
||||||
|
// - g++/clang++ -lbfd ...
|
||||||
|
// #define BACKWARD_HAS_BFD 1
|
||||||
|
|
||||||
|
// - apt-get install libdwarf-dev ...
|
||||||
|
// - g++/clang++ -ldwarf ...
|
||||||
|
// #define BACKWARD_HAS_DWARF 1
|
||||||
|
|
||||||
|
// Regardless of the library you choose to read the debug information,
|
||||||
|
// for potentially more detailed stack traces you can use libunwind
|
||||||
|
// - apt-get install libunwind-dev
|
||||||
|
// - g++/clang++ -lunwind
|
||||||
|
// #define BACKWARD_HAS_LIBUNWIND 1
|
||||||
|
|
||||||
|
#include "backward.hpp"
|
||||||
|
|
||||||
|
namespace backward {
|
||||||
|
|
||||||
|
backward::SignalHandling sh;
|
||||||
|
|
||||||
|
} // namespace backward
|
@ -1,29 +1,9 @@
|
|||||||
if (NOT PROJECT_STATIC_LINK)
|
if (NOT PROJECT_STATIC_LINK)
|
||||||
if(PROJECT_IS_MINGW)
|
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/deps/include)
|
||||||
add_definitions(-DCPPTRACE_UNWIND_WITH_DBGHELP)
|
|
||||||
else()
|
|
||||||
add_definitions(-DCPPTRACE_UNWIND_WITH_UNWIND)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FetchContent)
|
list(APPEND PROJECT_ADDITIONAL_SOURCES
|
||||||
FetchContent_Declare(
|
${CMAKE_CURRENT_SOURCE_DIR}/deps/src/backward.cpp
|
||||||
cpptrace
|
|
||||||
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
|
|
||||||
GIT_TAG v0.6.3
|
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(cpptrace)
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
add_custom_command(
|
|
||||||
TARGET ${PROJECT_NAME}
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
$<TARGET_FILE:cpptrace::cpptrace>
|
|
||||||
$<TARGET_FILE_DIR:your_target>
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
link_libraries(cpptrace::cpptrace)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}")
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#if !defined(PROJECT_STATIC_LINK)
|
#if !defined(PROJECT_STATIC_LINK)
|
||||||
#include "cpptrace/cpptrace.hpp"
|
#include "backward.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "cli/actions.hpp"
|
#include "cli/actions.hpp"
|
||||||
@ -33,7 +33,7 @@ using namespace repertory;
|
|||||||
|
|
||||||
auto main(int argc, char **argv) -> int {
|
auto main(int argc, char **argv) -> int {
|
||||||
#if !defined(PROJECT_STATIC_LINK)
|
#if !defined(PROJECT_STATIC_LINK)
|
||||||
cpptrace::register_terminate_handler();
|
static backward::SignalHandling sh;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (not repertory::project_initialize()) {
|
if (not repertory::project_initialize()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user