mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-01-28 19:52:08 +00:00
Compare commits
21 Commits
feature/bo
...
boost-1.87
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22982db3f6 | ||
|
|
088bf8ed7f | ||
|
|
344f6bae19 | ||
|
|
6504ed9ea4 | ||
|
|
a778e3d223 | ||
|
|
464e224c2f | ||
|
|
3f79aee92f | ||
|
|
da94896d2d | ||
|
|
0a1f8ac9a0 | ||
|
|
7c79d84614 | ||
|
|
e95c2723d8 | ||
|
|
9028c8a413 | ||
|
|
b37fc77b5d | ||
|
|
aa97b1a34c | ||
|
|
23e1213f54 | ||
|
|
ad121dbed0 | ||
|
|
981e37c218 | ||
|
|
cbf0df774d | ||
|
|
34e56c4e90 | ||
|
|
f32bd5a543 | ||
|
|
79fc075655 |
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -171,7 +171,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
||||||
shared: [ ON ] # https://github.com/boostorg/stacktrace/issues/169
|
shared: [ OFF, ON ]
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
||||||
shared: [ ON ] # https://github.com/boostorg/stacktrace/issues/169
|
shared: [ OFF, ON ]
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
||||||
shared: [ ON ] # https://github.com/boostorg/stacktrace/issues/169
|
shared: [ OFF, ON ]
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ windows-2019, windows-2022 ]
|
os: [ windows-2019, windows-2022 ]
|
||||||
shared: [ ON ] # https://github.com/boostorg/stacktrace/issues/169
|
shared: [ OFF, ON ]
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
|||||||
@@ -71,14 +71,21 @@ endif()
|
|||||||
stacktrace_check(BOOST_STACKTRACE_HAS_WINDBG has_windbg.cpp "" "dbgeng;ole32" "")
|
stacktrace_check(BOOST_STACKTRACE_HAS_WINDBG has_windbg.cpp "" "dbgeng;ole32" "")
|
||||||
stacktrace_check(BOOST_STACKTRACE_HAS_WINDBG_CACHED has_windbg_cached.cpp "${CMAKE_CURRENT_SOURCE_DIR}/../config/include" "dbgeng;ole32" "")
|
stacktrace_check(BOOST_STACKTRACE_HAS_WINDBG_CACHED has_windbg_cached.cpp "${CMAKE_CURRENT_SOURCE_DIR}/../config/include" "dbgeng;ole32" "")
|
||||||
|
|
||||||
|
set(_default_from_exception ON)
|
||||||
|
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64|i386|i686|x86")
|
||||||
|
set(_default_from_exception OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(BOOST_STACKTRACE_ENABLE_NOOP "Boost.Stacktrace: build boost_stacktrace_noop" ON)
|
option(BOOST_STACKTRACE_ENABLE_NOOP "Boost.Stacktrace: build boost_stacktrace_noop" ON)
|
||||||
option(BOOST_STACKTRACE_ENABLE_BACKTRACE "Boost.Stacktrace: build boost_stacktrace_backtrace" ${BOOST_STACKTRACE_HAS_BACKTRACE})
|
option(BOOST_STACKTRACE_ENABLE_BACKTRACE "Boost.Stacktrace: build boost_stacktrace_backtrace" ${BOOST_STACKTRACE_HAS_BACKTRACE})
|
||||||
option(BOOST_STACKTRACE_ENABLE_ADDR2LINE "Boost.Stacktrace: build boost_stacktrace_addr2line" ${_default_addr2line})
|
option(BOOST_STACKTRACE_ENABLE_ADDR2LINE "Boost.Stacktrace: build boost_stacktrace_addr2line" ${_default_addr2line})
|
||||||
option(BOOST_STACKTRACE_ENABLE_BASIC "Boost.Stacktrace: build boost_stacktrace_basic" ON)
|
option(BOOST_STACKTRACE_ENABLE_BASIC "Boost.Stacktrace: build boost_stacktrace_basic" ON)
|
||||||
option(BOOST_STACKTRACE_ENABLE_WINDBG "Boost.Stacktrace: build boost_stacktrace_windbg" ${BOOST_STACKTRACE_HAS_WINDBG})
|
option(BOOST_STACKTRACE_ENABLE_WINDBG "Boost.Stacktrace: build boost_stacktrace_windbg" ${BOOST_STACKTRACE_HAS_WINDBG})
|
||||||
option(BOOST_STACKTRACE_ENABLE_WINDBG_CACHED "Boost.Stacktrace: build boost_stacktrace_windbg_cached" ${BOOST_STACKTRACE_HAS_WINDBG_CACHED})
|
option(BOOST_STACKTRACE_ENABLE_WINDBG_CACHED "Boost.Stacktrace: build boost_stacktrace_windbg_cached" ${BOOST_STACKTRACE_HAS_WINDBG_CACHED})
|
||||||
|
option(BOOST_STACKTRACE_ENABLE_FROM_EXCEPTION "Boost.Stacktrace: build boost_stacktrace_from_exception" ${_default_from_exception})
|
||||||
|
|
||||||
unset(_default_addr2line)
|
unset(_default_addr2line)
|
||||||
|
unset(_default_from_exception)
|
||||||
|
|
||||||
message(STATUS "Boost.Stacktrace: "
|
message(STATUS "Boost.Stacktrace: "
|
||||||
"noop ${BOOST_STACKTRACE_ENABLE_NOOP}, "
|
"noop ${BOOST_STACKTRACE_ENABLE_NOOP}, "
|
||||||
@@ -86,7 +93,8 @@ message(STATUS "Boost.Stacktrace: "
|
|||||||
"addr2line ${BOOST_STACKTRACE_ENABLE_ADDR2LINE}, "
|
"addr2line ${BOOST_STACKTRACE_ENABLE_ADDR2LINE}, "
|
||||||
"basic ${BOOST_STACKTRACE_ENABLE_BASIC}, "
|
"basic ${BOOST_STACKTRACE_ENABLE_BASIC}, "
|
||||||
"windbg ${BOOST_STACKTRACE_ENABLE_WINDBG}, "
|
"windbg ${BOOST_STACKTRACE_ENABLE_WINDBG}, "
|
||||||
"windbg_cached ${BOOST_STACKTRACE_ENABLE_WINDBG_CACHED}"
|
"windbg_cached ${BOOST_STACKTRACE_ENABLE_WINDBG_CACHED}, "
|
||||||
|
"from_exception ${BOOST_STACKTRACE_ENABLE_FROM_EXCEPTION}"
|
||||||
)
|
)
|
||||||
|
|
||||||
stacktrace_add_library(noop ${BOOST_STACKTRACE_ENABLE_NOOP} "" "")
|
stacktrace_add_library(noop ${BOOST_STACKTRACE_ENABLE_NOOP} "" "")
|
||||||
@@ -125,6 +133,9 @@ elseif(BOOST_STACKTRACE_ENABLE_NOOP)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Boost::stacktrace_from_exception is never the default
|
||||||
|
stacktrace_add_library(from_exception ${BOOST_STACKTRACE_ENABLE_FROM_EXCEPTION} "${CMAKE_DL_LIBS};boost_stacktrace" "")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||||
|
|||||||
9
boost-stacktrace-features.jam
Normal file
9
boost-stacktrace-features.jam
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (C) 2016-2024, Antony Polukhin.
|
||||||
|
#
|
||||||
|
# Use, modification and distribution is subject to the Boost Software License,
|
||||||
|
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
#
|
||||||
|
import feature ;
|
||||||
|
|
||||||
|
feature.feature boost.stacktrace.from_exception : on off : optional propagated ;
|
||||||
52
build.jam
Normal file
52
build.jam
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Copyright René Ferdinand Rivera Morell 2023-2024
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
require-b2 5.2 ;
|
||||||
|
|
||||||
|
import boost-stacktrace-features ;
|
||||||
|
|
||||||
|
constant boost_dependencies :
|
||||||
|
<library>/boost/config//boost_config
|
||||||
|
<library>/boost/container_hash//boost_container_hash
|
||||||
|
<library>/boost/core//boost_core
|
||||||
|
<library>/boost/predef//boost_predef
|
||||||
|
<target-os>windows:<library>/boost/winapi//boost_winapi ;
|
||||||
|
|
||||||
|
project /boost/stacktrace
|
||||||
|
: common-requirements
|
||||||
|
<include>include
|
||||||
|
;
|
||||||
|
|
||||||
|
explicit
|
||||||
|
[ alias boost_stacktrace_addr2line : build//boost_stacktrace_addr2line ]
|
||||||
|
[ alias boost_stacktrace_backtrace : build//boost_stacktrace_backtrace ]
|
||||||
|
[ alias boost_stacktrace_basic : build//boost_stacktrace_basic ]
|
||||||
|
[ alias boost_stacktrace_from_exception : build//boost_stacktrace_from_exception ]
|
||||||
|
[ alias boost_stacktrace_noop : build//boost_stacktrace_noop ]
|
||||||
|
[ alias boost_stacktrace_windbg : build//boost_stacktrace_windbg ]
|
||||||
|
[ alias boost_stacktrace_windbg_cached : build//boost_stacktrace_windbg_cached ]
|
||||||
|
[ alias boost_stacktrace : boost_stacktrace_noop ]
|
||||||
|
[ alias all :
|
||||||
|
boost_stacktrace_addr2line
|
||||||
|
boost_stacktrace_backtrace
|
||||||
|
boost_stacktrace_basic
|
||||||
|
boost_stacktrace_from_exception
|
||||||
|
boost_stacktrace_noop
|
||||||
|
boost_stacktrace_windbg
|
||||||
|
boost_stacktrace_windbg_cached
|
||||||
|
test
|
||||||
|
]
|
||||||
|
;
|
||||||
|
|
||||||
|
call-if : boost-library stacktrace
|
||||||
|
: install
|
||||||
|
boost_stacktrace_addr2line
|
||||||
|
boost_stacktrace_backtrace
|
||||||
|
boost_stacktrace_basic
|
||||||
|
boost_stacktrace_from_exception
|
||||||
|
boost_stacktrace_noop
|
||||||
|
boost_stacktrace_windbg
|
||||||
|
boost_stacktrace_windbg_cached
|
||||||
|
;
|
||||||
@@ -5,14 +5,21 @@
|
|||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
#
|
#
|
||||||
|
|
||||||
import feature ;
|
require-b2 5.0.1 ;
|
||||||
|
import-search /boost/config/checks ;
|
||||||
|
import boost-stacktrace-features ;
|
||||||
|
import config : requires ;
|
||||||
import property ;
|
import property ;
|
||||||
import ../../config/checks/config : requires ;
|
|
||||||
|
constant boost_dependencies_private :
|
||||||
|
<library>/boost/assert//boost_assert
|
||||||
|
;
|
||||||
|
|
||||||
project
|
project
|
||||||
: source-location .
|
: common-requirements $(boost_dependencies)
|
||||||
: requirements
|
: requirements
|
||||||
[ requires cxx11_rvalue_references ]
|
[ requires cxx11_rvalue_references ]
|
||||||
|
$(boost_dependencies_private)
|
||||||
: default-build
|
: default-build
|
||||||
<visibility>hidden
|
<visibility>hidden
|
||||||
;
|
;
|
||||||
@@ -22,14 +29,12 @@ lib gcc_s ;
|
|||||||
lib Dbgeng ;
|
lib Dbgeng ;
|
||||||
lib ole32 ;
|
lib ole32 ;
|
||||||
|
|
||||||
feature.feature boost.stacktrace.from_exception : on off : optional propagated ;
|
|
||||||
|
|
||||||
local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ;
|
local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ;
|
||||||
lib backtrace
|
lib backtrace
|
||||||
:
|
:
|
||||||
: <search>$(LIBBACKTRACE_PATH)/lib <link>static
|
: <search>$(LIBBACKTRACE_PATH)/lib <link>static
|
||||||
:
|
:
|
||||||
: <include>$(LIBBACKTRACE_PATH)/include
|
: <include>$(LIBBACKTRACE_PATH)/include
|
||||||
;
|
;
|
||||||
|
|
||||||
actions mp_simple_run_action
|
actions mp_simple_run_action
|
||||||
@@ -67,6 +72,7 @@ lib boost_stacktrace_noop
|
|||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
lib boost_stacktrace_backtrace
|
lib boost_stacktrace_backtrace
|
||||||
@@ -77,10 +83,11 @@ lib boost_stacktrace_backtrace
|
|||||||
<target-os>linux:<library>dl
|
<target-os>linux:<library>dl
|
||||||
<library>backtrace
|
<library>backtrace
|
||||||
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
[ check-target-builds ../build//libbacktrace : : <build>no ]
|
[ check-target-builds libbacktrace : : <build>no ]
|
||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
lib boost_stacktrace_addr2line
|
lib boost_stacktrace_addr2line
|
||||||
@@ -90,10 +97,11 @@ lib boost_stacktrace_addr2line
|
|||||||
<warnings>all
|
<warnings>all
|
||||||
<target-os>linux:<library>dl
|
<target-os>linux:<library>dl
|
||||||
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
[ check-target-builds ../build//addr2line : : <build>no ]
|
[ check-target-builds addr2line : : <build>no ]
|
||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
lib boost_stacktrace_basic
|
lib boost_stacktrace_basic
|
||||||
@@ -103,10 +111,11 @@ lib boost_stacktrace_basic
|
|||||||
<warnings>all
|
<warnings>all
|
||||||
<target-os>linux:<library>dl
|
<target-os>linux:<library>dl
|
||||||
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
[ check-target-builds ../build//WinDbg : <build>no ]
|
[ check-target-builds WinDbg : <build>no ]
|
||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
lib boost_stacktrace_windbg
|
lib boost_stacktrace_windbg
|
||||||
@@ -116,10 +125,11 @@ lib boost_stacktrace_windbg
|
|||||||
<warnings>all
|
<warnings>all
|
||||||
<library>Dbgeng <library>ole32
|
<library>Dbgeng <library>ole32
|
||||||
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
[ check-target-builds ../build//WinDbg : : <build>no ]
|
[ check-target-builds WinDbg : : <build>no ]
|
||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
lib boost_stacktrace_windbg_cached
|
lib boost_stacktrace_windbg_cached
|
||||||
@@ -129,10 +139,11 @@ lib boost_stacktrace_windbg_cached
|
|||||||
<warnings>all
|
<warnings>all
|
||||||
<library>Dbgeng <library>ole32
|
<library>Dbgeng <library>ole32
|
||||||
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
[ check-target-builds ../build//WinDbgCached : : <build>no ]
|
[ check-target-builds WinDbgCached : : <build>no ]
|
||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
rule build-stacktrace-from-exception ( props * )
|
rule build-stacktrace-from-exception ( props * )
|
||||||
@@ -162,10 +173,9 @@ lib boost_stacktrace_from_exception
|
|||||||
<conditional>@build-stacktrace-from-exception
|
<conditional>@build-stacktrace-from-exception
|
||||||
|
|
||||||
# Require usable libbacktrace on other platforms
|
# Require usable libbacktrace on other platforms
|
||||||
#[ check-target-builds ../build//libbacktrace : : <build>no ]
|
# [ check-target-builds libbacktrace : : <build>no ]
|
||||||
: # default build
|
: # default build
|
||||||
: # usage-requirements
|
: # usage-requirements
|
||||||
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
|
||||||
|
<define>BOOST_STACKTRACE_NO_LIB=1
|
||||||
;
|
;
|
||||||
|
|
||||||
boost-install boost_stacktrace_noop boost_stacktrace_backtrace boost_stacktrace_addr2line boost_stacktrace_basic boost_stacktrace_windbg boost_stacktrace_windbg_cached boost_stacktrace_from_exception ;
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import doxygen ;
|
|||||||
|
|
||||||
doxygen autodoc
|
doxygen autodoc
|
||||||
:
|
:
|
||||||
[ glob ../../../boost/stacktrace.hpp ]
|
[ glob ../include/boost/stacktrace.hpp ]
|
||||||
[ glob ../../../boost/stacktrace/*.hpp ]
|
[ glob ../include/boost/stacktrace/*.hpp ]
|
||||||
[ glob ../../../boost/stacktrace/detail/frame_decl.hpp ]
|
[ glob ../include/boost/stacktrace/detail/frame_decl.hpp ]
|
||||||
:
|
:
|
||||||
<doxygen:param>EXTRACT_ALL=NO
|
<doxygen:param>EXTRACT_ALL=NO
|
||||||
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
|
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ int main() {
|
|||||||
foo("test1");
|
foo("test1");
|
||||||
bar("test2");
|
bar("test2");
|
||||||
} catch (const std::exception& exc) {
|
} catch (const std::exception& exc) {
|
||||||
boost::stacktrace::stacktrace trace = boost::stacktrace::from_current_exception(); // <---
|
boost::stacktrace::stacktrace trace = boost::stacktrace::stacktrace::from_current_exception(); // <---
|
||||||
std::cerr << "Caught exception: " << exc.what() << ", trace:\n" << trace;
|
std::cerr << "Caught exception: " << exc.what() << ", trace:\n" << trace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#define BOOST_USER_CONFIG <libs/stacktrace/example/user_config.hpp>
|
#define BOOST_USER_CONFIG <example/user_config.hpp>
|
||||||
|
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
#include <exception> // std::set_terminate, std::abort
|
#include <exception> // std::set_terminate, std::abort
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include <boost/stacktrace/detail/try_dec_convert.hpp>
|
#include <boost/stacktrace/detail/try_dec_convert.hpp>
|
||||||
#include <boost/core/demangle.hpp>
|
#include <boost/core/demangle.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -116,12 +117,14 @@ inline std::string addr2line(const char* flag, const void* addr) {
|
|||||||
std::string res;
|
std::string res;
|
||||||
|
|
||||||
boost::stacktrace::detail::location_from_symbol loc(addr);
|
boost::stacktrace::detail::location_from_symbol loc(addr);
|
||||||
if (!loc.empty()) {
|
// For programs started through $PATH loc.name() is not absolute and
|
||||||
|
// addr2line will fail.
|
||||||
|
if (!loc.empty() && std::strchr(loc.name(), '/') != nullptr) {
|
||||||
res = loc.name();
|
res = loc.name();
|
||||||
} else {
|
} else {
|
||||||
res.resize(16);
|
res.resize(16);
|
||||||
int rlin_size = ::readlink("/proc/self/exe", &res[0], res.size() - 1);
|
ssize_t rlin_size = ::readlink("/proc/self/exe", &res[0], res.size() - 1);
|
||||||
while (rlin_size == static_cast<int>(res.size() - 1)) {
|
while (rlin_size == static_cast<ssize_t>(res.size() - 1)) {
|
||||||
res.resize(res.size() * 4);
|
res.resize(res.size() * 4);
|
||||||
rlin_size = ::readlink("/proc/self/exe", &res[0], res.size() - 1);
|
rlin_size = ::readlink("/proc/self/exe", &res[0], res.size() - 1);
|
||||||
}
|
}
|
||||||
@@ -129,7 +132,7 @@ inline std::string addr2line(const char* flag, const void* addr) {
|
|||||||
res.clear();
|
res.clear();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
res.resize(rlin_size);
|
res.resize(static_cast<std::size_t>(rlin_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
addr2line_pipe p(flag, res.c_str(), to_hex_array(addr).data());
|
addr2line_pipe p(flag, res.c_str(), to_hex_array(addr).data());
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ std::size_t this_thread_frames::collect(native_frame_ptr_t* out_frames, std::siz
|
|||||||
#else
|
#else
|
||||||
boost::stacktrace::detail::unwind_state state = { skip, out_frames, out_frames + max_frames_count };
|
boost::stacktrace::detail::unwind_state state = { skip, out_frames, out_frames + max_frames_count };
|
||||||
::_Unwind_Backtrace(&boost::stacktrace::detail::unwind_callback, &state);
|
::_Unwind_Backtrace(&boost::stacktrace::detail::unwind_callback, &state);
|
||||||
frames_count = state.current - out_frames;
|
frames_count = static_cast<std::size_t>(state.current - out_frames);
|
||||||
#endif //defined(BOOST_STACKTRACE_USE_LIBC_BACKTRACE_FUNCTION)
|
#endif //defined(BOOST_STACKTRACE_USE_LIBC_BACKTRACE_FUNCTION)
|
||||||
|
|
||||||
if (frames_count && out_frames[frames_count - 1] == 0) {
|
if (frames_count && out_frames[frames_count - 1] == 0) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#if defined(__clang__) || defined(BOOST_MSVC)
|
||||||
# pragma comment(lib, "ole32.lib")
|
# pragma comment(lib, "ole32.lib")
|
||||||
# pragma comment(lib, "Dbgeng.lib")
|
# pragma comment(lib, "Dbgeng.lib")
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ inline int libbacktrace_full_callback(void *data, uintptr_t /*pc*/, const char *
|
|||||||
if (d.function && function) {
|
if (d.function && function) {
|
||||||
*d.function = function;
|
*d.function = function;
|
||||||
}
|
}
|
||||||
d.line = lineno;
|
d.line = static_cast<std::size_t>(lineno);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,11 @@
|
|||||||
# define BOOST_STACKTRACE_LINK
|
# define BOOST_STACKTRACE_LINK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_STACKTRACE_LINK) && !defined(BOOST_STACKTRACE_DYN_LINK) && defined(BOOST_ALL_DYN_LINK)
|
#if !defined(BOOST_STACKTRACE_LINK) && defined(BOOST_STACKTRACE_STATIC_LINK)
|
||||||
|
# define BOOST_STACKTRACE_LINK
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_STACKTRACE_LINK) && !defined(BOOST_STACKTRACE_DYN_LINK) && !defined(BOOST_STACKTRACE_STATIC_LINK) && defined(BOOST_ALL_DYN_LINK)
|
||||||
# define BOOST_STACKTRACE_DYN_LINK
|
# define BOOST_STACKTRACE_DYN_LINK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,20 @@
|
|||||||
#include <boost/stacktrace/detail/frame_decl.hpp>
|
#include <boost/stacktrace/detail/frame_decl.hpp>
|
||||||
#include <boost/stacktrace/detail/push_options.h>
|
#include <boost/stacktrace/detail/push_options.h>
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC) && (defined(BOOST_STACKTRACE_INTERNAL_BUILD_LIBS) || !defined(BOOST_STACKTRACE_LINK))
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
#if defined(BOOST_STACKTRACE_DYN_LINK)
|
||||||
|
BOOST_SYMBOL_EXPORT
|
||||||
|
#elif defined(BOOST_STACKTRACE_LINK)
|
||||||
|
#else
|
||||||
|
BOOST_SYMBOL_EXPORT inline
|
||||||
|
#endif
|
||||||
|
void* boost_stacktrace_impl_return_nullptr() { return nullptr; }
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost { namespace stacktrace {
|
namespace boost { namespace stacktrace {
|
||||||
|
|
||||||
/// Comparison operators that provide platform dependant ordering and have O(1) complexity; are Async-Handler-Safe.
|
/// Comparison operators that provide platform dependant ordering and have O(1) complexity; are Async-Handler-Safe.
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
BOOST_SYMBOL_EXPORT inline void* boost_stacktrace_impl_return_nullptr() { return nullptr; }
|
|
||||||
const char* boost_stacktrace_impl_current_exception_stacktrace();
|
const char* boost_stacktrace_impl_current_exception_stacktrace();
|
||||||
bool* boost_stacktrace_impl_ref_capture_stacktraces_at_throw();
|
bool* boost_stacktrace_impl_ref_capture_stacktraces_at_throw();
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ BOOST_SYMBOL_EXPORT void assert_no_pending_traces() noexcept {
|
|||||||
#include <boost/stacktrace/safe_dump_to.hpp>
|
#include <boost/stacktrace/safe_dump_to.hpp>
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <exception>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
#if !BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING
|
#if !BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
# define _GNU_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BOOST_STACKTRACE_INTERNAL_BUILD_LIBS
|
#define BOOST_STACKTRACE_INTERNAL_BUILD_LIBS
|
||||||
#define BOOST_STACKTRACE_LINK
|
#define BOOST_STACKTRACE_LINK
|
||||||
#include <boost/stacktrace/detail/frame_msvc.ipp>
|
#include <boost/stacktrace/detail/frame_msvc.ipp>
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
# define _GNU_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BOOST_STACKTRACE_INTERNAL_BUILD_LIBS
|
#define BOOST_STACKTRACE_INTERNAL_BUILD_LIBS
|
||||||
#define BOOST_STACKTRACE_LINK
|
#define BOOST_STACKTRACE_LINK
|
||||||
#define BOOST_STACKTRACE_USE_WINDBG_CACHED
|
#define BOOST_STACKTRACE_USE_WINDBG_CACHED
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
#
|
#
|
||||||
|
|
||||||
import ../../config/checks/config : requires ;
|
import-search /boost/config/checks ;
|
||||||
|
import config : requires ;
|
||||||
|
import testing ;
|
||||||
|
|
||||||
lib dl : : <link>shared ;
|
lib dl : : <link>shared ;
|
||||||
lib gcc_s ;
|
lib gcc_s ;
|
||||||
@@ -31,6 +33,8 @@ project
|
|||||||
<warnings>all
|
<warnings>all
|
||||||
<test-info>always_show_run_output
|
<test-info>always_show_run_output
|
||||||
<visibility>hidden
|
<visibility>hidden
|
||||||
|
<include>..
|
||||||
|
<library>/boost/optional//boost_optional
|
||||||
;
|
;
|
||||||
|
|
||||||
local FORCE_SYMBOL_EXPORT = <target-os>freebsd:<linkflags>"-rdynamic" <target-os>solaris:<linkflags>"-Bdynamic" <target-os>aix:<linkflags>"-rdynamic"
|
local FORCE_SYMBOL_EXPORT = <target-os>freebsd:<linkflags>"-rdynamic" <target-os>solaris:<linkflags>"-Bdynamic" <target-os>aix:<linkflags>"-rdynamic"
|
||||||
@@ -122,15 +126,19 @@ test-suite stacktrace_tests
|
|||||||
[ run thread_safety_checking.cpp
|
[ run thread_safety_checking.cpp
|
||||||
: : : <debug-symbols>on <library>.//test_impl_lib_backtrace $(LINKSHARED_BT)
|
: : : <debug-symbols>on <library>.//test_impl_lib_backtrace $(LINKSHARED_BT)
|
||||||
<define>BOOST_STACKTRACE_BACKTRACE_FORCE_STATIC
|
<define>BOOST_STACKTRACE_BACKTRACE_FORCE_STATIC
|
||||||
|
<library>/boost/optional//boost_optional
|
||||||
: backtrace_lib_threaded_static ]
|
: backtrace_lib_threaded_static ]
|
||||||
[ run thread_safety_checking.cpp
|
[ run thread_safety_checking.cpp
|
||||||
: : : <debug-symbols>on <library>.//test_impl_lib_windbg $(LINKSHARED_WIND)
|
: : : <debug-symbols>on <library>.//test_impl_lib_windbg $(LINKSHARED_WIND)
|
||||||
|
<library>/boost/optional//boost_optional
|
||||||
: windbg_lib_threaded ]
|
: windbg_lib_threaded ]
|
||||||
[ run thread_safety_checking.cpp
|
[ run thread_safety_checking.cpp
|
||||||
: : : <debug-symbols>on <library>.//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED)
|
: : : <debug-symbols>on <library>.//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED)
|
||||||
|
<library>/boost/optional//boost_optional
|
||||||
: windbg_cached_lib_threaded ]
|
: windbg_cached_lib_threaded ]
|
||||||
[ run thread_safety_checking.cpp
|
[ run thread_safety_checking.cpp
|
||||||
: : : <debug-symbols>on <library>.//test_impl_lib_basic $(LINKSHARED_BASIC)
|
: : : <debug-symbols>on <library>.//test_impl_lib_basic $(LINKSHARED_BASIC)
|
||||||
|
<library>/boost/optional//boost_optional
|
||||||
: basic_lib_threaded ]
|
: basic_lib_threaded ]
|
||||||
|
|
||||||
##### Tests with disabled debug symbols #####
|
##### Tests with disabled debug symbols #####
|
||||||
@@ -158,6 +166,7 @@ test-suite stacktrace_tests
|
|||||||
[ run thread_safety_checking.cpp
|
[ run thread_safety_checking.cpp
|
||||||
: : : <debug-symbols>off
|
: : : <debug-symbols>off
|
||||||
<library>.//test_impl_lib_backtrace_no_dbg
|
<library>.//test_impl_lib_backtrace_no_dbg
|
||||||
|
<library>/boost/optional//boost_optional
|
||||||
$(LINKSHARED_BT)
|
$(LINKSHARED_BT)
|
||||||
: backtrace_lib_no_dbg_threaded ]
|
: backtrace_lib_no_dbg_threaded ]
|
||||||
[ run thread_safety_checking.cpp
|
[ run thread_safety_checking.cpp
|
||||||
@@ -179,6 +188,8 @@ test-suite stacktrace_tests
|
|||||||
[ run test_void_ptr_cast.cpp ]
|
[ run test_void_ptr_cast.cpp ]
|
||||||
[ run test_num_conv.cpp ]
|
[ run test_num_conv.cpp ]
|
||||||
|
|
||||||
|
[ run test_from_exception_none.cpp : : : $(LINKSHARED_NOOP) <debug-symbols>on : from_exception_none_noop ]
|
||||||
|
[ run test_from_exception_none.cpp : : : <define>BOOST_STACKTRACE_USE_NOOP $(NOOP_DEPS) <debug-symbols>on : from_exception_none_noop_ho ]
|
||||||
[ run test_from_exception_none.cpp : : : $(LINKSHARED_BASIC) <debug-symbols>on : from_exception_none_basic ]
|
[ run test_from_exception_none.cpp : : : $(LINKSHARED_BASIC) <debug-symbols>on : from_exception_none_basic ]
|
||||||
[ run test_from_exception_none.cpp : : : $(FORCE_SYMBOL_EXPORT) $(BASIC_DEPS) <debug-symbols>on : from_exception_none_basic_ho ]
|
[ run test_from_exception_none.cpp : : : $(FORCE_SYMBOL_EXPORT) $(BASIC_DEPS) <debug-symbols>on : from_exception_none_basic_ho ]
|
||||||
[ run test_from_exception_none.cpp : : : $(LINKSHARED_BT) <debug-symbols>on : from_exception_none_bt ]
|
[ run test_from_exception_none.cpp : : : $(LINKSHARED_BT) <debug-symbols>on : from_exception_none_bt ]
|
||||||
@@ -188,6 +199,8 @@ test-suite stacktrace_tests
|
|||||||
[ run test_from_exception_none.cpp : : : $(LINKSHARED_WIND_CACHED) <debug-symbols>on : from_exception_none_windbg_cached ]
|
[ run test_from_exception_none.cpp : : : $(LINKSHARED_WIND_CACHED) <debug-symbols>on : from_exception_none_windbg_cached ]
|
||||||
[ run test_from_exception_none.cpp : : : <define>BOOST_STACKTRACE_USE_WINDBG_CACHED $(WICA_DEPS) <debug-symbols>on : from_exception_none_windbg_cached_ho ]
|
[ run test_from_exception_none.cpp : : : <define>BOOST_STACKTRACE_USE_WINDBG_CACHED $(WICA_DEPS) <debug-symbols>on : from_exception_none_windbg_cached_ho ]
|
||||||
|
|
||||||
|
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(LINKSHARED_NOOP) <debug-symbols>on : from_exception_disabled_none ]
|
||||||
|
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception <define>BOOST_STACKTRACE_USE_NOOP $(NOOP_DEPS) : from_exception_disabled_none_ho ]
|
||||||
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(LINKSHARED_BASIC) <debug-symbols>on : from_exception_disabled_basic ]
|
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(LINKSHARED_BASIC) <debug-symbols>on : from_exception_disabled_basic ]
|
||||||
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(FORCE_SYMBOL_EXPORT) $(BASIC_DEPS) <debug-symbols>on : from_exception_disabled_basic_ho ]
|
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(FORCE_SYMBOL_EXPORT) $(BASIC_DEPS) <debug-symbols>on : from_exception_disabled_basic_ho ]
|
||||||
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(LINKSHARED_BT) <debug-symbols>on : from_exception_disabled_bt ]
|
[ run test_from_exception_none.cpp : : : <library>/boost/stacktrace//boost_stacktrace_from_exception $(LINKSHARED_BT) <debug-symbols>on : from_exception_disabled_bt ]
|
||||||
@@ -212,15 +225,15 @@ test-suite stacktrace_tests
|
|||||||
for local p in [ glob ../example/*.cpp ]
|
for local p in [ glob ../example/*.cpp ]
|
||||||
{
|
{
|
||||||
local target_name = $(p[1]:B) ;
|
local target_name = $(p[1]:B) ;
|
||||||
local additional_dependency = ;
|
local additional_dependency = <library>/boost/array//boost_array ;
|
||||||
if $(target_name) = "terminate_handler"
|
if $(target_name) = "terminate_handler"
|
||||||
{
|
{
|
||||||
additional_dependency = <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt ;
|
additional_dependency += <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(target_name) = "throwing_st"
|
if $(target_name) = "throwing_st"
|
||||||
{
|
{
|
||||||
additional_dependency = [ requires rtti ] ;
|
additional_dependency += [ requires rtti ] <library>/boost/exception//boost_exception ;
|
||||||
}
|
}
|
||||||
|
|
||||||
stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_BT) $(additional_dependency) : backtrace_$(p2[1]:B) ] ;
|
stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_BT) $(additional_dependency) : backtrace_$(p2[1]:B) ] ;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ before_build:
|
|||||||
libs/filesystem libs/atomic libs/system libs/interprocess libs/array
|
libs/filesystem libs/atomic libs/system libs/interprocess libs/array
|
||||||
libs/iterator libs/detail libs/exception libs/smart_ptr libs/mpl
|
libs/iterator libs/detail libs/exception libs/smart_ptr libs/mpl
|
||||||
libs/align libs/container libs/tuple libs/intrusive libs/scope
|
libs/align libs/container libs/tuple libs/intrusive libs/scope
|
||||||
|
libs/variant2 libs/preprocessor libs/io
|
||||||
|
|
||||||
- rm -rf %BOOST%/libs/%BOOST_LIBS_FOLDER%
|
- rm -rf %BOOST%/libs/%BOOST_LIBS_FOLDER%
|
||||||
- mv -f %APPVEYOR_BUILD_FOLDER% %BOOST%/libs/%BOOST_LIBS_FOLDER%
|
- mv -f %APPVEYOR_BUILD_FOLDER% %BOOST%/libs/%BOOST_LIBS_FOLDER%
|
||||||
|
|||||||
Reference in New Issue
Block a user