3 Commits

Author SHA1 Message Date
28f7f5cb14 cleanup
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-07-27 09:17:34 -05:00
624b92bc97 enable backward-cpp for test 2024-07-27 09:14:51 -05:00
ca799298f4 switch to backward-cpp 2024-07-27 09:13:43 -05:00
6 changed files with 4552 additions and 26 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

42
deps/src/backward.cpp vendored Normal file
View 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

View File

@ -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}")

View File

@ -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()) {

View File

@ -19,9 +19,12 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#if !defined(PROJECT_STATIC_LINK)
#include "backward.hpp"
#endif
#include "initialize.hpp" #include "initialize.hpp"
#include "test_common.hpp" #include "test_common.hpp"
#include "utils/error_utils.hpp"
#if defined(_WIN32) #if defined(_WIN32)
#include "utils/cli_utils.hpp" #include "utils/cli_utils.hpp"
#endif // _WIN32 #endif // _WIN32
@ -33,6 +36,10 @@ std::size_t PROVIDER_INDEX{0U};
#endif // _WIN32 #endif // _WIN32
auto main(int argc, char **argv) -> int { auto main(int argc, char **argv) -> int {
#if !defined(PROJECT_STATIC_LINK)
static backward::SignalHandling sh;
#endif
if (not repertory::project_initialize()) { if (not repertory::project_initialize()) {
std::cerr << "fatal: failed to initialize repertory" << std::endl; std::cerr << "fatal: failed to initialize repertory" << std::endl;
return -1; return -1;