mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-01-30 08:22:08 +00:00
Compare commits
1 Commits
apolukhin-
...
feature/gh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07fd4c1e98 |
356
.github/workflows/ci.yml
vendored
356
.github/workflows/ci.yml
vendored
@@ -30,6 +30,15 @@ jobs:
|
|||||||
- toolset: clang-15
|
- toolset: clang-15
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-12
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-13
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-14
|
||||||
# TODO: fix and uncomment
|
# TODO: fix and uncomment
|
||||||
#- toolset: clang
|
#- toolset: clang
|
||||||
# cxxstd: "03,11,14,17,2a"
|
# cxxstd: "03,11,14,17,2a"
|
||||||
@@ -40,7 +49,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
@@ -118,15 +127,15 @@ jobs:
|
|||||||
cxxstd: "14,17,latest"
|
cxxstd: "14,17,latest"
|
||||||
addrmd: 64
|
addrmd: 64
|
||||||
os: windows-2019
|
os: windows-2019
|
||||||
#- toolset: gcc
|
- toolset: gcc
|
||||||
# cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
# addrmd: 64
|
addrmd: 64
|
||||||
# os: windows-2019
|
os: windows-2019
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Boost
|
- name: Setup Boost
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -165,338 +174,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.github_token }}
|
github-token: ${{ secrets.github_token }}
|
||||||
parallel-finished: true
|
parallel-finished: true
|
||||||
|
|
||||||
posix-cmake-subdir:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
|
||||||
shared: [ OFF, ON ]
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install packages
|
|
||||||
if: matrix.install
|
|
||||||
run: sudo apt-get -y install ${{matrix.install}}
|
|
||||||
|
|
||||||
- name: Setup Boost
|
|
||||||
run: |
|
|
||||||
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
|
||||||
LIBRARY=${GITHUB_REPOSITORY#*/}
|
|
||||||
echo LIBRARY: $LIBRARY
|
|
||||||
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
|
||||||
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
|
||||||
echo GITHUB_REF: $GITHUB_REF
|
|
||||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
|
||||||
REF=${REF#refs/heads/}
|
|
||||||
echo REF: $REF
|
|
||||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
|
||||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
|
||||||
cd ..
|
|
||||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
|
||||||
cd boost-root
|
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
|
||||||
git submodule update --init tools/boostdep
|
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
|
||||||
|
|
||||||
- name: Use library with add_subdirectory
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
|
|
||||||
mkdir __build__ && cd __build__
|
|
||||||
cmake -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
|
||||||
cmake --build .
|
|
||||||
ctest --output-on-failure --no-tests=error
|
|
||||||
|
|
||||||
posix-cmake-install:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
|
||||||
shared: [ OFF, ON ]
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install packages
|
|
||||||
if: matrix.install
|
|
||||||
run: sudo apt-get -y install ${{matrix.install}}
|
|
||||||
|
|
||||||
- name: Setup Boost
|
|
||||||
run: |
|
|
||||||
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
|
||||||
LIBRARY=${GITHUB_REPOSITORY#*/}
|
|
||||||
echo LIBRARY: $LIBRARY
|
|
||||||
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
|
||||||
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
|
||||||
echo GITHUB_REF: $GITHUB_REF
|
|
||||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
|
||||||
REF=${REF#refs/heads/}
|
|
||||||
echo REF: $REF
|
|
||||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
|
||||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
|
||||||
cd ..
|
|
||||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
|
||||||
cd boost-root
|
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
|
||||||
git submodule update --init tools/boostdep
|
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
run: |
|
|
||||||
cd ../boost-root
|
|
||||||
mkdir __build__ && cd __build__
|
|
||||||
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
cmake --build .
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
cmake --build . --target install
|
|
||||||
|
|
||||||
- name: Use the installed library
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
|
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
|
||||||
cmake --build .
|
|
||||||
export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH
|
|
||||||
ctest --output-on-failure --no-tests=error
|
|
||||||
|
|
||||||
posix-cmake-test:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14 ]
|
|
||||||
shared: [ OFF, ON ]
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install packages
|
|
||||||
if: matrix.install
|
|
||||||
run: sudo apt-get -y install ${{matrix.install}}
|
|
||||||
|
|
||||||
- name: Setup Boost
|
|
||||||
run: |
|
|
||||||
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
|
||||||
LIBRARY=${GITHUB_REPOSITORY#*/}
|
|
||||||
echo LIBRARY: $LIBRARY
|
|
||||||
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
|
||||||
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
|
||||||
echo GITHUB_REF: $GITHUB_REF
|
|
||||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
|
||||||
REF=${REF#refs/heads/}
|
|
||||||
echo REF: $REF
|
|
||||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
|
||||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
|
||||||
cd ..
|
|
||||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
|
||||||
cd boost-root
|
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
|
||||||
git submodule update --init tools/boostdep
|
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
|
||||||
|
|
||||||
- name: Configure (Debug)
|
|
||||||
run: |
|
|
||||||
cd ../boost-root
|
|
||||||
mkdir __build_debug__ && cd __build_debug__
|
|
||||||
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} -DCMAKE_BUILD_TYPE=Debug ..
|
|
||||||
|
|
||||||
- name: Build tests (Debug)
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build_debug__
|
|
||||||
cmake --build . --target tests
|
|
||||||
|
|
||||||
- name: Run tests (Debug)
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build_debug__
|
|
||||||
ctest --output-on-failure --no-tests=error
|
|
||||||
|
|
||||||
windows-cmake-subdir:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ windows-2019, windows-2022 ]
|
|
||||||
shared: [ OFF, ON ]
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Boost
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
|
||||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
|
||||||
echo LIBRARY: %LIBRARY%
|
|
||||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
|
||||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
|
||||||
echo GITHUB_REF: %GITHUB_REF%
|
|
||||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
|
||||||
set BOOST_BRANCH=develop
|
|
||||||
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
|
||||||
echo BOOST_BRANCH: %BOOST_BRANCH%
|
|
||||||
cd ..
|
|
||||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
|
||||||
cd boost-root
|
|
||||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
|
||||||
git submodule update --init tools/boostdep
|
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
|
||||||
|
|
||||||
- name: Use library with add_subdirectory (Debug)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
|
|
||||||
mkdir __build__ && cd __build__
|
|
||||||
cmake -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
|
||||||
cmake --build . --config Debug
|
|
||||||
ctest --output-on-failure --no-tests=error -C Debug
|
|
||||||
|
|
||||||
- name: Use library with add_subdirectory (RelWithDebInfo)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
|
|
||||||
cmake --build . --config RelWithDebInfo
|
|
||||||
ctest --output-on-failure --no-tests=error -C RelWithDebInfo
|
|
||||||
|
|
||||||
windows-cmake-install:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ windows-2019, windows-2022 ]
|
|
||||||
shared: [ OFF, ON ]
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Boost
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
|
||||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
|
||||||
echo LIBRARY: %LIBRARY%
|
|
||||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
|
||||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
|
||||||
echo GITHUB_REF: %GITHUB_REF%
|
|
||||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
|
||||||
set BOOST_BRANCH=develop
|
|
||||||
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
|
||||||
echo BOOST_BRANCH: %BOOST_BRANCH%
|
|
||||||
cd ..
|
|
||||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
|
||||||
cd boost-root
|
|
||||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
|
||||||
git submodule update --init tools/boostdep
|
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root
|
|
||||||
mkdir __build__ && cd __build__
|
|
||||||
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
|
||||||
|
|
||||||
- name: Install (Debug)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
cmake --build . --target install --config Debug
|
|
||||||
|
|
||||||
- name: Install (RelWithDebInfo)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
cmake --build . --target install --config RelWithDebInfo
|
|
||||||
|
|
||||||
- name: Use the installed library (Debug)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
|
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
|
||||||
cmake --build . --config Debug
|
|
||||||
PATH C:\cmake-prefix\bin;%PATH%
|
|
||||||
ctest --output-on-failure --no-tests=error -C Debug
|
|
||||||
|
|
||||||
- name: Use the installed library (RelWithDebInfo)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
|
|
||||||
cmake --build . --config RelWithDebInfo
|
|
||||||
PATH C:\cmake-prefix\bin;%PATH%
|
|
||||||
ctest --output-on-failure --no-tests=error -C RelWithDebInfo
|
|
||||||
|
|
||||||
windows-cmake-test:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ windows-2019, windows-2022 ]
|
|
||||||
shared: [ OFF, ON ]
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Boost
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
|
||||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
|
||||||
echo LIBRARY: %LIBRARY%
|
|
||||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
|
||||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
|
||||||
echo GITHUB_REF: %GITHUB_REF%
|
|
||||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
|
||||||
set BOOST_BRANCH=develop
|
|
||||||
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
|
||||||
echo BOOST_BRANCH: %BOOST_BRANCH%
|
|
||||||
cd ..
|
|
||||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
|
||||||
cd boost-root
|
|
||||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
|
||||||
git submodule update --init tools/boostdep
|
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root
|
|
||||||
mkdir __build__ && cd __build__
|
|
||||||
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
|
||||||
|
|
||||||
- name: Build tests (Debug)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
cmake --build . --target tests --config Debug
|
|
||||||
|
|
||||||
- name: Run tests (Debug)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
ctest --output-on-failure --no-tests=error -C Debug
|
|
||||||
|
|
||||||
- name: Build tests (RelWithDebInfo)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
cmake --build . --target tests --config RelWithDebInfo
|
|
||||||
|
|
||||||
- name: Run tests (RelWithDebInfo)
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
cd ../boost-root/__build__
|
|
||||||
ctest --output-on-failure --no-tests=error -C RelWithDebInfo
|
|
||||||
|
|||||||
@@ -90,43 +90,12 @@ message(STATUS "Boost.Stacktrace: "
|
|||||||
)
|
)
|
||||||
|
|
||||||
stacktrace_add_library(noop ${BOOST_STACKTRACE_ENABLE_NOOP} "" "")
|
stacktrace_add_library(noop ${BOOST_STACKTRACE_ENABLE_NOOP} "" "")
|
||||||
stacktrace_add_library(backtrace ${BOOST_STACKTRACE_ENABLE_BACKTRACE} "backtrace;${CMAKE_DL_LIBS}" "")
|
stacktrace_add_library(backtrace ${BOOST_STACKTRACE_ENABLE_BACKTRACE} "backtrace" "")
|
||||||
stacktrace_add_library(addr2line ${BOOST_STACKTRACE_ENABLE_ADDR2LINE} "${CMAKE_DL_LIBS}" "")
|
stacktrace_add_library(addr2line ${BOOST_STACKTRACE_ENABLE_ADDR2LINE} "" "")
|
||||||
stacktrace_add_library(basic ${BOOST_STACKTRACE_ENABLE_BASIC} "${CMAKE_DL_LIBS}" "")
|
stacktrace_add_library(basic ${BOOST_STACKTRACE_ENABLE_BASIC} "" "")
|
||||||
stacktrace_add_library(windbg ${BOOST_STACKTRACE_ENABLE_WINDBG} "dbgeng;ole32" "_GNU_SOURCE=1")
|
stacktrace_add_library(windbg ${BOOST_STACKTRACE_ENABLE_WINDBG} "dbgeng;ole32" "_GNU_SOURCE=1")
|
||||||
stacktrace_add_library(windbg_cached ${BOOST_STACKTRACE_ENABLE_WINDBG_CACHED} "dbgeng;ole32" "_GNU_SOURCE=1")
|
stacktrace_add_library(windbg_cached ${BOOST_STACKTRACE_ENABLE_WINDBG_CACHED} "dbgeng;ole32" "_GNU_SOURCE=1")
|
||||||
|
|
||||||
# boost_stacktrace, default library
|
|
||||||
|
|
||||||
add_library(boost_stacktrace INTERFACE)
|
|
||||||
add_library(Boost::stacktrace ALIAS boost_stacktrace)
|
|
||||||
|
|
||||||
target_include_directories(boost_stacktrace INTERFACE include)
|
|
||||||
|
|
||||||
if(BOOST_STACKTRACE_ENABLE_WINDBG)
|
|
||||||
|
|
||||||
target_link_libraries(boost_stacktrace INTERFACE Boost::stacktrace_windbg)
|
|
||||||
|
|
||||||
elseif(BOOST_STACKTRACE_ENABLE_BACKTRACE)
|
|
||||||
|
|
||||||
target_link_libraries(boost_stacktrace INTERFACE Boost::stacktrace_backtrace)
|
|
||||||
|
|
||||||
elseif(BOOST_STACKTRACE_ENABLE_ADDR2LINE)
|
|
||||||
|
|
||||||
target_link_libraries(boost_stacktrace INTERFACE Boost::stacktrace_addr2line)
|
|
||||||
|
|
||||||
elseif(BOOST_STACKTRACE_ENABLE_BASIC)
|
|
||||||
|
|
||||||
target_link_libraries(boost_stacktrace INTERFACE Boost::stacktrace_basic)
|
|
||||||
|
|
||||||
elseif(BOOST_STACKTRACE_ENABLE_NOOP)
|
|
||||||
|
|
||||||
target_link_libraries(boost_stacktrace INTERFACE Boost::stacktrace_noop)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
|
|
||||||
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||||
|
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
|||||||
50
build.jam
50
build.jam
@@ -1,50 +0,0 @@
|
|||||||
# 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 ;
|
|
||||||
|
|
||||||
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,21 +5,13 @@
|
|||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
#
|
#
|
||||||
|
|
||||||
require-b2 5.0.1 ;
|
|
||||||
import-search /boost/config/checks ;
|
|
||||||
import config : requires ;
|
|
||||||
import feature ;
|
import feature ;
|
||||||
import property ;
|
import ../../config/checks/config : requires ;
|
||||||
|
|
||||||
constant boost_dependencies_private :
|
|
||||||
<library>/boost/assert//boost_assert
|
|
||||||
;
|
|
||||||
|
|
||||||
project
|
project
|
||||||
: common-requirements $(boost_dependencies)
|
: source-location .
|
||||||
: requirements
|
: requirements
|
||||||
[ requires cxx11_rvalue_references ]
|
[ requires cxx11_rvalue_references ]
|
||||||
$(boost_dependencies_private)
|
|
||||||
: default-build
|
: default-build
|
||||||
<visibility>hidden
|
<visibility>hidden
|
||||||
;
|
;
|
||||||
@@ -33,10 +25,10 @@ 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
|
||||||
@@ -74,7 +66,6 @@ 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
|
||||||
@@ -85,11 +76,10 @@ 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 libbacktrace : : <build>no ]
|
[ check-target-builds ../build//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
|
||||||
@@ -99,11 +89,10 @@ 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 addr2line : : <build>no ]
|
[ check-target-builds ../build//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
|
||||||
@@ -113,11 +102,10 @@ 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 WinDbg : <build>no ]
|
[ check-target-builds ../build//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
|
||||||
@@ -127,11 +115,10 @@ 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 WinDbg : : <build>no ]
|
[ check-target-builds ../build//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
|
||||||
@@ -141,29 +128,12 @@ 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 WinDbgCached : : <build>no ]
|
[ check-target-builds ../build//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 * )
|
|
||||||
{
|
|
||||||
local enabled = [ property.select <boost.stacktrace.from_exception> : $(props) ] ;
|
|
||||||
switch $(enabled:G=)
|
|
||||||
{
|
|
||||||
case "on" : return ;
|
|
||||||
case "off" : return <build>no ;
|
|
||||||
}
|
|
||||||
|
|
||||||
local arch = [ property.select <architecture> : $(props) ] ;
|
|
||||||
if $(arch) && ( $(arch:G=) != x86 )
|
|
||||||
{
|
|
||||||
return <build>no ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lib boost_stacktrace_from_exception
|
lib boost_stacktrace_from_exception
|
||||||
: # sources
|
: # sources
|
||||||
../src/from_exception.cpp
|
../src/from_exception.cpp
|
||||||
@@ -171,14 +141,14 @@ lib boost_stacktrace_from_exception
|
|||||||
<warnings>all
|
<warnings>all
|
||||||
<target-os>linux:<library>dl
|
<target-os>linux:<library>dl
|
||||||
|
|
||||||
# Enable build when explicitly requested, or by default, when on x86
|
# Command line option to disable build
|
||||||
<conditional>@build-stacktrace-from-exception
|
<boost.stacktrace.from_exception>off:<build>no
|
||||||
|
|
||||||
# Require usable libbacktrace on other platforms
|
# Require usable libbacktrace on other platforms
|
||||||
# [ check-target-builds libbacktrace : : <build>no ]
|
#[ check-target-builds ../build//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
|
|
||||||
<define>BOOST_STACKTRACE_LINKED_WITH_FROM_EXCEPTION=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 ../include/boost/stacktrace.hpp ]
|
[ glob ../../../boost/stacktrace.hpp ]
|
||||||
[ glob ../include/boost/stacktrace/*.hpp ]
|
[ glob ../../../boost/stacktrace/*.hpp ]
|
||||||
[ glob ../include/boost/stacktrace/detail/frame_decl.hpp ]
|
[ glob ../../../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::stacktrace::from_current_exception(); // <---
|
boost::stacktrace::stacktrace trace = boost::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 <example/user_config.hpp>
|
#define BOOST_USER_CONFIG <libs/stacktrace/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,7 +18,6 @@
|
|||||||
#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>
|
||||||
@@ -117,14 +116,12 @@ 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);
|
||||||
// For programs started through $PATH loc.name() is not absolute and
|
if (!loc.empty()) {
|
||||||
// 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);
|
||||||
ssize_t rlin_size = ::readlink("/proc/self/exe", &res[0], res.size() - 1);
|
int rlin_size = ::readlink("/proc/self/exe", &res[0], res.size() - 1);
|
||||||
while (rlin_size == static_cast<ssize_t>(res.size() - 1)) {
|
while (rlin_size == static_cast<int>(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);
|
||||||
}
|
}
|
||||||
@@ -132,7 +129,7 @@ inline std::string addr2line(const char* flag, const void* addr) {
|
|||||||
res.clear();
|
res.clear();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
res.resize(static_cast<std::size_t>(rlin_size));
|
res.resize(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 = static_cast<std::size_t>(state.current - out_frames);
|
frames_count = 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>
|
||||||
|
|
||||||
#if defined(__clang__) || defined(BOOST_MSVC)
|
#ifdef BOOST_MSVC
|
||||||
# pragma comment(lib, "ole32.lib")
|
# pragma comment(lib, "ole32.lib")
|
||||||
# pragma comment(lib, "Dbgeng.lib")
|
# pragma comment(lib, "Dbgeng.lib")
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ std::string frame::name() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
||||||
boost::stacktrace::detail::Dl_info dli;
|
::Dl_info dli;
|
||||||
const bool dl_ok = !!boost::stacktrace::detail::dladdr(addr_, dli);
|
const bool dl_ok = !!::dladdr(const_cast<void*>(addr_), &dli); // `dladdr` on Solaris accepts nonconst addresses
|
||||||
if (dl_ok && dli.dli_sname) {
|
if (dl_ok && dli.dli_sname) {
|
||||||
return boost::core::demangle(dli.dli_sname);
|
return boost::core::demangle(dli.dli_sname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = static_cast<std::size_t>(lineno);
|
d.line = lineno;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,110 +18,17 @@
|
|||||||
# include <boost/winapi/dll.hpp>
|
# include <boost/winapi/dll.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _AIX
|
|
||||||
/* AIX doesn't provide dladdr syscall.
|
|
||||||
This provides a minimal implementation of dladdr which retrieves
|
|
||||||
only files information.
|
|
||||||
TODO: Implement the symbol name. */
|
|
||||||
|
|
||||||
#include <sys/ldr.h>
|
|
||||||
#include <sys/debug.h>
|
|
||||||
#include <cstring>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace boost { namespace stacktrace { namespace detail {
|
|
||||||
|
|
||||||
struct Dl_info {
|
|
||||||
std::string fname_storage{};
|
|
||||||
const char *dli_fname = nullptr;
|
|
||||||
const char *dli_sname = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
int dladdr(const void* address_raw, Dl_info* info) noexcept {
|
|
||||||
static constexpr std::size_t dl_buff_size = 0x1000;
|
|
||||||
|
|
||||||
try {
|
|
||||||
std::vector<struct ld_info> pld_info_storage;
|
|
||||||
pld_info_storage.resize(
|
|
||||||
(dl_buff_size + sizeof(struct ld_info) - 1) / sizeof(struct ld_info)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (loadquery(L_GETINFO, pld_info_storage.data(), dl_buff_size) == -1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto* pld_info = pld_info_storage.data();
|
|
||||||
const char* const address = static_cast<const char*>(address_raw);
|
|
||||||
while (true) {
|
|
||||||
const auto* const dataorg = static_cast<char*>(pld_info->ldinfo_dataorg);
|
|
||||||
const auto* const textorg = static_cast<char*>(pld_info->ldinfo_textorg);
|
|
||||||
if ((address >= dataorg && address < dataorg + pld_info->ldinfo_datasize )
|
|
||||||
|| (address >= textorg && address < textorg + pld_info->ldinfo_textsize )) {
|
|
||||||
|
|
||||||
/* ldinfo_filename is the null-terminated path name followed
|
|
||||||
by null-terminated member name.
|
|
||||||
If the file is not an archive, then member name is null. */
|
|
||||||
const auto size_filename = std::strlen(pld_info->ldinfo_filename);
|
|
||||||
const auto size_member = std::strlen(pld_info->ldinfo_filename + size_filename + 1);
|
|
||||||
|
|
||||||
/* If member is not null, '(' and ')' must be added to create a
|
|
||||||
fname looking like "filename(membername)". */
|
|
||||||
info->fname_storage.reserve(size_filename + (size_member ? size_member + 3 : 1));
|
|
||||||
info->fname_storage = pld_info->ldinfo_filename;
|
|
||||||
if (size_member) {
|
|
||||||
info->fname_storage += "(";
|
|
||||||
info->fname_storage += pld_info->ldinfo_filename + size_filename + 1;
|
|
||||||
info->fname_storage += ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
info->dli_fname = info->fname_storage.c_str();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pld_info->ldinfo_next) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
pld_info = reinterpret_cast<const struct ld_info *>(
|
|
||||||
reinterpret_cast<const char*>(pld_info) + pld_info->ldinfo_next
|
|
||||||
);
|
|
||||||
};
|
|
||||||
} catch (...) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}}} // namespace boost::stacktrace::detail
|
|
||||||
|
|
||||||
#elif !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
|
||||||
|
|
||||||
namespace boost { namespace stacktrace { namespace detail {
|
|
||||||
|
|
||||||
using Dl_info = ::Dl_info;
|
|
||||||
|
|
||||||
inline int dladdr(const void* addr, Dl_info& dli) noexcept {
|
|
||||||
// `dladdr` on Solaris accepts nonconst addresses
|
|
||||||
return ::dladdr(const_cast<void*>(addr), &dli);
|
|
||||||
}
|
|
||||||
|
|
||||||
}}} // namespace boost::stacktrace::detail
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost { namespace stacktrace { namespace detail {
|
namespace boost { namespace stacktrace { namespace detail {
|
||||||
|
|
||||||
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
||||||
class location_from_symbol {
|
class location_from_symbol {
|
||||||
boost::stacktrace::detail::Dl_info dli_;
|
::Dl_info dli_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit location_from_symbol(const void* addr) noexcept
|
explicit location_from_symbol(const void* addr) noexcept
|
||||||
: dli_()
|
: dli_()
|
||||||
{
|
{
|
||||||
if (!boost::stacktrace::detail::dladdr(addr, dli_)) {
|
if (!::dladdr(const_cast<void*>(addr), &dli_)) { // `dladdr` on Solaris accepts nonconst addresses
|
||||||
dli_.dli_fname = 0;
|
dli_.dli_fname = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,7 @@
|
|||||||
# define BOOST_STACKTRACE_LINK
|
# define BOOST_STACKTRACE_LINK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(BOOST_STACKTRACE_LINK) && defined(BOOST_STACKTRACE_STATIC_LINK)
|
#if defined(BOOST_STACKTRACE_LINK) && !defined(BOOST_STACKTRACE_DYN_LINK) && defined(BOOST_ALL_DYN_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
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace boost { namespace stacktrace {
|
|||||||
/// @cond
|
/// @cond
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
using native_frame_ptr_t = const void*;
|
typedef const void* native_frame_ptr_t; // TODO: change to `typedef void(*native_frame_ptr_t)();`
|
||||||
enum helper{ max_frames_dump = 128 };
|
enum helper{ max_frames_dump = 128 };
|
||||||
|
|
||||||
BOOST_STACKTRACE_FUNCTION std::size_t from_dump(const char* filename, native_frame_ptr_t* out_frames);
|
BOOST_STACKTRACE_FUNCTION std::size_t from_dump(const char* filename, native_frame_ptr_t* out_frames);
|
||||||
@@ -52,7 +52,7 @@ struct this_thread_frames { // struct is required to avoid warning about usage o
|
|||||||
BOOST_NOINLINE BOOST_STACKTRACE_FUNCTION static std::size_t collect(native_frame_ptr_t* out_frames, std::size_t max_frames_count, std::size_t skip) noexcept;
|
BOOST_NOINLINE BOOST_STACKTRACE_FUNCTION static std::size_t collect(native_frame_ptr_t* out_frames, std::size_t max_frames_count, std::size_t skip) noexcept;
|
||||||
|
|
||||||
BOOST_NOINLINE static std::size_t safe_dump_to_impl(void* memory, std::size_t size, std::size_t skip) noexcept {
|
BOOST_NOINLINE static std::size_t safe_dump_to_impl(void* memory, std::size_t size, std::size_t skip) noexcept {
|
||||||
using boost::stacktrace::detail::native_frame_ptr_t;
|
typedef boost::stacktrace::detail::native_frame_ptr_t native_frame_ptr_t;
|
||||||
|
|
||||||
if (size < sizeof(native_frame_ptr_t)) {
|
if (size < sizeof(native_frame_ptr_t)) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -66,7 +66,7 @@ struct this_thread_frames { // struct is required to avoid warning about usage o
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
BOOST_NOINLINE static std::size_t safe_dump_to_impl(T file, std::size_t skip, std::size_t max_depth) noexcept {
|
BOOST_NOINLINE static std::size_t safe_dump_to_impl(T file, std::size_t skip, std::size_t max_depth) noexcept {
|
||||||
using boost::stacktrace::detail::native_frame_ptr_t;
|
typedef boost::stacktrace::detail::native_frame_ptr_t native_frame_ptr_t;
|
||||||
|
|
||||||
native_frame_ptr_t buffer[boost::stacktrace::detail::max_frames_dump + 1];
|
native_frame_ptr_t buffer[boost::stacktrace::detail::max_frames_dump + 1];
|
||||||
if (max_depth > boost::stacktrace::detail::max_frames_dump) {
|
if (max_depth > boost::stacktrace::detail::max_frames_dump) {
|
||||||
|
|||||||
@@ -37,18 +37,12 @@
|
|||||||
|
|
||||||
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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef BOOST_STACKTRACE_LINKED_WITH_FROM_EXCEPTION
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
BOOST_SYMBOL_EXPORT
|
|
||||||
inline void* boost_stacktrace_impl_return_nullptr() { return nullptr; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
# pragma comment(linker, "/ALTERNATENAME:_boost_stacktrace_impl_current_exception_stacktrace=_boost_stacktrace_impl_return_nullptr")
|
# pragma comment(linker, "/ALTERNATENAME:_boost_stacktrace_impl_current_exception_stacktrace=_boost_stacktrace_impl_return_nullptr")
|
||||||
# pragma comment(linker, "/ALTERNATENAME:_boost_stacktrace_impl_ref_capture_stacktraces_at_throw=_boost_stacktrace_impl_return_nullptr")
|
# pragma comment(linker, "/ALTERNATENAME:_boost_stacktrace_impl_ref_capture_stacktraces_at_throw=_boost_stacktrace_impl_return_nullptr")
|
||||||
@@ -57,8 +51,6 @@ inline void* boost_stacktrace_impl_return_nullptr() { return nullptr; }
|
|||||||
# pragma comment(linker, "/ALTERNATENAME:boost_stacktrace_impl_ref_capture_stacktraces_at_throw=boost_stacktrace_impl_return_nullptr")
|
# pragma comment(linker, "/ALTERNATENAME:boost_stacktrace_impl_ref_capture_stacktraces_at_throw=boost_stacktrace_impl_return_nullptr")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // #ifndef BOOST_STACKTRACE_LINKED_WITH_FROM_EXCEPTION
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost { namespace stacktrace {
|
namespace boost { namespace stacktrace {
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ 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
|
||||||
@@ -234,7 +233,7 @@ static const char*& reference_to_empty_padding(void* ptr) noexcept {
|
|||||||
if (is_libcpp_runtime()) {
|
if (is_libcpp_runtime()) {
|
||||||
// libc++-runtime
|
// libc++-runtime
|
||||||
BOOST_ASSERT_MSG(
|
BOOST_ASSERT_MSG(
|
||||||
sizeof(void*) != 4,
|
sizeof(void*) == 4,
|
||||||
"32bit platforms are unsupported with libc++ runtime padding reusage. "
|
"32bit platforms are unsupported with libc++ runtime padding reusage. "
|
||||||
"Please report this issue to the library maintainters."
|
"Please report this issue to the library maintainters."
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,10 +4,6 @@
|
|||||||
// 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,10 +4,6 @@
|
|||||||
// 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
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
# Copyright 2018-2020 Peter Dimov
|
|
||||||
# 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
|
|
||||||
|
|
||||||
include(BoostTest OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
|
||||||
|
|
||||||
if(NOT HAVE_BOOST_TEST)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
boost_test(TYPE run SOURCES test.cpp test_impl.cpp LINK_LIBRARIES Boost::stacktrace Boost::core)
|
|
||||||
boost_test(TYPE run SOURCES test_noop.cpp test_impl.cpp LINK_LIBRARIES Boost::stacktrace_noop Boost::core)
|
|
||||||
|
|
||||||
boost_test(TYPE run SOURCES test_trivial.cpp LINK_LIBRARIES Boost::stacktrace Boost::core)
|
|
||||||
@@ -5,9 +5,7 @@
|
|||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
#
|
#
|
||||||
|
|
||||||
import-search /boost/config/checks ;
|
import ../../config/checks/config : requires ;
|
||||||
import config : requires ;
|
|
||||||
import testing ;
|
|
||||||
|
|
||||||
lib dl : : <link>shared ;
|
lib dl : : <link>shared ;
|
||||||
lib gcc_s ;
|
lib gcc_s ;
|
||||||
@@ -26,15 +24,13 @@ lib backtrace
|
|||||||
|
|
||||||
project
|
project
|
||||||
: requirements
|
: requirements
|
||||||
[ requires cxx11_rvalue_references cxx11_template_aliases cxx11_noexcept ]
|
[ requires cxx11_rvalue_references ]
|
||||||
<toolset>msvc:<asynch-exceptions>on
|
<toolset>msvc:<asynch-exceptions>on
|
||||||
<toolset>intel:<cxxflags>-wd2196
|
<toolset>intel:<cxxflags>-wd2196
|
||||||
<target-os>linux:<linkflags>-lpthread
|
<target-os>linux:<linkflags>-lpthread
|
||||||
<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"
|
||||||
@@ -126,19 +122,15 @@ 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 #####
|
||||||
@@ -166,7 +158,6 @@ 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
|
||||||
@@ -221,15 +212,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 = <library>/boost/array//boost_array ;
|
local additional_dependency = ;
|
||||||
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 ] <library>/boost/exception//boost_exception ;
|
additional_dependency = [ requires rtti ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
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,7 +66,6 @@ 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%
|
||||||
|
|||||||
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
# Copyright 2018-2021 Peter Dimov
|
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
# https://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5...3.20)
|
|
||||||
|
|
||||||
project(cmake_install_test LANGUAGES CXX)
|
|
||||||
|
|
||||||
find_package(boost_stacktrace REQUIRED)
|
|
||||||
|
|
||||||
add_executable(main main.cpp)
|
|
||||||
target_link_libraries(main Boost::stacktrace)
|
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
add_test(main main)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
// Copyright 2019 Peter Dimov
|
|
||||||
// Copyright 2022-2024 Antony Polukhin
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
#include <boost/stacktrace/stacktrace.hpp>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << boost::stacktrace::stacktrace() << std::endl;
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
# Copyright 2018-2021 Peter Dimov
|
|
||||||
# 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
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5...3.20)
|
|
||||||
|
|
||||||
project(cmake_subdir_test LANGUAGES CXX)
|
|
||||||
|
|
||||||
# Put boost_stacktrace_*.dll in the same directory as main.exe
|
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
||||||
|
|
||||||
add_subdirectory(../.. boostorg/stacktrace)
|
|
||||||
|
|
||||||
# boostdep --brief stacktrace
|
|
||||||
|
|
||||||
set(deps
|
|
||||||
|
|
||||||
# Primary dependencies
|
|
||||||
|
|
||||||
assert
|
|
||||||
config
|
|
||||||
container_hash
|
|
||||||
core
|
|
||||||
predef
|
|
||||||
winapi
|
|
||||||
|
|
||||||
# Secondary dependencies
|
|
||||||
|
|
||||||
describe
|
|
||||||
mp11
|
|
||||||
static_assert
|
|
||||||
throw_exception
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach(dep IN LISTS deps)
|
|
||||||
|
|
||||||
add_subdirectory(../../../${dep} boostorg/${dep})
|
|
||||||
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
add_executable(main main.cpp)
|
|
||||||
target_link_libraries(main Boost::stacktrace)
|
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
add_test(main main)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
// Copyright 2019 Peter Dimov
|
|
||||||
// Copyright 2022-2024 Antony Polukhin
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
#include <boost/stacktrace/stacktrace.hpp>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << boost::stacktrace::stacktrace() << std::endl;
|
|
||||||
}
|
|
||||||
@@ -257,12 +257,6 @@ void test_empty_basic_stacktrace() {
|
|||||||
BOOST_TEST(!(st > st_t(0, 0)));
|
BOOST_TEST(!(st > st_t(0, 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_stacktrace_limits()
|
|
||||||
{
|
|
||||||
BOOST_TEST_EQ(boost::stacktrace::stacktrace(0, 1).size(), 1);
|
|
||||||
BOOST_TEST_EQ(boost::stacktrace::stacktrace(1, 1).size(), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
test_deeply_nested_namespaces();
|
test_deeply_nested_namespaces();
|
||||||
test_frames_string_data_validity();
|
test_frames_string_data_validity();
|
||||||
@@ -281,8 +275,8 @@ int main() {
|
|||||||
test_comparisons_base(make_some_stacktrace1(), make_some_stacktrace2());
|
test_comparisons_base(make_some_stacktrace1(), make_some_stacktrace2());
|
||||||
|
|
||||||
test_nested<260>(false);
|
test_nested<260>(false);
|
||||||
|
BOOST_TEST(boost::stacktrace::stacktrace(0, 1).size() == 1);
|
||||||
test_stacktrace_limits();
|
BOOST_TEST(boost::stacktrace::stacktrace(1, 1).size() == 1);
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user