550 Commits

Author SHA1 Message Date
Antony Polukhin
902537345a Update copyright years 2026-01-04 11:21:08 +03:00
dependabot[bot]
3db7d98f0e Bump actions/checkout from 4 to 6 (#222)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-26 20:37:08 +03:00
Antony Polukhin
e54be17b87 Add dependabot 2025-12-24 20:08:15 +03:00
Antony Polukhin
b2f10f7efd More tests and docs on CMake installation (#213) 2025-12-24 20:05:46 +03:00
Antony Polukhin
77647f8b06 Check for potential memory leak at runtime rather than at compile time (#220)
Closes: https://github.com/boostorg/stacktrace/pull/217
2025-12-24 20:05:06 +03:00
David McFarland
b36c55b3d9 Disable from_exception on cygwin. (#219)
Cygwin doesn't have RTDL_NEXT, which causes a compile error with the
non-windows implementation.  I'm not sure which implementation would be
better to use, so just disable it for now.
2025-12-23 18:51:13 +03:00
Antony Polukhin
6ef20c3ab7 Simplify has_addr2line check to not link with C++ Standard Library (#216)
Fixes: https://github.com/boostorg/stacktrace/issues/209
2025-12-11 22:15:19 +03:00
Jonathan Wakely
cec57009ef Fix URL in libbacktrace_impls.hpp (#214)
The double slash in the URL redirects to the bugzilla main page.
boost-1.90.0.beta1 boost-1.90.0
2025-10-29 22:44:29 +03:00
Antony Polukhin
cf5992230b Update CI runners and minor fixes (#210) 2025-09-09 12:01:23 +03:00
Orgad Shaneh
07bc960cfe Add missing cstdint header (#207)
Fixes https://github.com/boostorg/boost/issues/1044
2025-06-01 09:38:06 +03:00
Antony Polukhin
d6499f26d4 Fix stacktrace_from_exception builds with MinGW (#206)
Fixes https://github.com/boostorg/stacktrace/issues/196
boost-1.89.0 boost-1.88.0.beta1 boost-1.88.0
2025-02-18 13:41:40 +03:00
Antony Polukhin
d408cf4468 Document build options and use windbg_cached in Boost::stacktrace in CMake (#205) 2025-01-28 21:34:31 +03:00
Antony Polukhin
9d314b2b47 Force features to override library detections and make separate rules for each feature check with diagnostic messages (#203) 2025-01-23 21:56:26 +03:00
Uilian Ries
54934a386a Expose stacktrace libraries as build features (#202)
As I commented in the issue #195, this PR exposes all stacktrace libraries as boost features, mirroring what's available in the CMakeLists.txt in this project. So users will be able to build or not specific libraries present in this project. Here are some keypoints to evaluate these new changes:

- Added `build-stacktrace-feature` as generic rule validate on/off entry from users for each feature
- For `addr2line` I added a rule to disable in case using Windows and not Cygwin. It reflects the rule present in CMakeLists.txt: https://github.com/boostorg/stacktrace/blob/develop/CMakeLists.txt#L67

close #195

Signed-off-by: Uilian Ries <uilianries@gmail.com>
2025-01-18 13:26:21 +03:00
Antony Polukhin
ea282324b8 Fix some warnings on MSVC (#201) 2025-01-11 12:36:57 +03:00
Antony Polukhin
9e7a98a61a Update copyright years 2025-01-08 19:54:11 +03:00
Maciej Czarnecki
b170b28479 Use Relative Virtual Addresses to allow their decoding without knowing the base address (#200)
Instead of printing absolute addresses use relative ones so they can be used later to decode the stack trace.

## Motivation

It’s quite common to release apps without debug symbols while keeping them internally. Currently the lib prints absolute addresses which require the base address to decode them using symbols. With this change, the base address won’t be needed as values are relative to the beginning of the loaded module/binary.

The implementation for unix is **straightforward** as the existing code is used. For Windows, I’ve implemented similar logic using Windows API.

## Manual testing of Windows implementation

Here are 2 runs of `trivial_windbg_lib.exe` with .pdb and without .pdb file:

```jsx
>./trivial_windbg_lib.exe
 0# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::init at C:\Users\czarneckim\repositories\boost\boost\stacktrace\stacktrace.hpp:110
 1# main at C:\Users\czarneckim\repositories\boost\libs\stacktrace\test\test_trivial.cpp:14
 2# __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
 3# BaseThreadInitThunk in C:\WINDOWS\System32\KERNEL32.DLL
 4# RtlUserThreadStart in C:\WINDOWS\SYSTEM32\ntdll.dll

> mv ./trivial_windbg_lib.pdb{,_} 
> ./trivial_windbg_lib.exe
 0# 0x0000000000001DE3 in C:\Users\czarneckim\repositories\boost\bin.v2\libs\stacktrace\test\trivial_windbg_lib.test\msvc-14.3\release\x86_64\asynch-exceptions-on\cxxstd-latest-iso\debug-symbols-on\threading-multi\trivial_windbg_lib.exe
 1# 0x0000000000001FEE in C:\Users\czarneckim\repositories\boost\bin.v2\libs\stacktrace\test\trivial_windbg_lib.test\msvc-14.3\release\x86_64\asynch-exceptions-on\cxxstd-latest-iso\debug-symbols-on\threading-multi\trivial_windbg_lib.exe
 2# 0x000000000000246C in C:\Users\czarneckim\repositories\boost\bin.v2\libs\stacktrace\test\trivial_windbg_lib.test\msvc-14.3\release\x86_64\asynch-exceptions-on\cxxstd-latest-iso\debug-symbols-on\threading-multi\trivial_windbg_lib.exe
 3# BaseThreadInitThunk in C:\WINDOWS\System32\KERNEL32.DLL
 4# RtlUserThreadStart in C:\WINDOWS\SYSTEM32\ntdll.dll

> mv ./trivial_windbg_lib.pdb{_,}
> winaddr2line.exe -f -e trivial_windbg_lib.pdb 0x0000000000001DE3
boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::init
C:\Users\czarneckim\repositories\boost\boost\stacktrace\stacktrace.hpp:110
```

I’ve also decoded the returned address using x64dbg running `trivial_windbg_lib.exe+0x0000000000001DE3`:

![image](https://github.com/user-attachments/assets/a36d3306-488d-4610-9f04-7888b98c2b75)

## Control

As it was suggested in #180, the new logic is enabled by default, but can be disabled with `BOOST_STACKTRACE_DISABLE_OFFSET_ADDR_BASE` (With non header-only mode, it requires rebuilding the lib)
2025-01-07 23:59:16 +03:00
Antony Polukhin
5ec45912da Autodetect stacktrace dependencies in Appveyor CI runs (#199) 2024-12-22 18:47:19 +03:00
Antony Polukhin
679bd845aa Add libs/function_types dependency for Appveyor tests 2024-12-22 16:40:11 +03:00
Antony Polukhin
0bcc382ab5 Add libs/concept_check dependency for Appveyor tests 2024-12-22 16:25:09 +03:00
Antony Polukhin
a64b8b7985 Do not test on macos-12 as the images are not available any more (take 2) 2024-12-22 16:22:14 +03:00
Antony Polukhin
92b1c794b3 Do not test on macos-12 as the images are not available any more 2024-12-22 14:06:12 +03:00
Daniel Krügler
8c4e50324c Use GetModuleNames to determine the full module path for msvc implementation 2024-12-22 01:24:02 +03:00
Dmitry Arkhipov
22982db3f6 fix setting custom b2 feature from CLI (#194) boost-1.87.0 2024-11-19 11:00:46 +03:00
Antony Polukhin
088bf8ed7f Fix stacktrace_from_exception CMake builds (#191) boost-1.87.0.beta1 2024-10-17 11:57:19 +03:00
Antony Polukhin
344f6bae19 Always link boost_stacktrace/Boost::stacktrace with Boost::stacktrace_from_exception if it is awailable in CMake 2024-10-16 15:13:44 +03:00
int mian
6504ed9ea4 Add CMake target boost_stacktrace_from_exception (#189)
Fixes #188
2024-10-16 15:11:09 +03:00
Antony Polukhin
a778e3d223 cleanup 2024-09-15 19:03:09 +03:00
huangqinjin
464e224c2f Don't export boost_stacktrace_impl_return_nullptr for static build (#186)
Now `boost_stacktrace.lib` provides the symbol `boost_stacktrace_impl_return_nullptr` for static and shared build.

For header only library, to make the symbol available **automatically**, the only way AFAIK is to export it. We may also consider provide a configuration macro to opt-out the exported symbol, and user need to manually define the non-exported symbol somewhere in their binaries.

Closes #177 .
2024-09-13 20:42:31 +03:00
Antony Polukhin
3f79aee92f Revert fix attempt for #177 2024-09-12 22:27:45 +03:00
Antony Polukhin
da94896d2d Fix attempt for #177 2024-09-12 22:00:21 +03:00
Antony Polukhin
0a1f8ac9a0 Fix Appveyor CI runs (#183) 2024-09-12 18:26:16 +03:00
Antony Polukhin
7c79d84614 fix attempt for Appveyor 2024-09-12 11:31:04 +03:00
Antony Polukhin
e95c2723d8 Add auto linking when using clang compiler under Visual Studio (fixes #100) 2024-09-12 11:15:03 +03:00
Antony Polukhin
9028c8a413 Attempt to fix weird build issues with CYGWIN and MacOS (fixes #88) 2024-09-12 11:14:26 +03:00
Antony Polukhin
b37fc77b5d Attempt to fix weird build issues with CYGWIN and MacOS (fixes #88) 2024-09-12 11:04:52 +03:00
Mats Taraldsvik
aa97b1a34c Fix missing namespace in stacktrace.qbk (#181) 2024-09-12 10:36:53 +03:00
Julien Schueller
23e1213f54 Fix missing include for std::exception (#178)
Fixes build on mingw: 
from_exception.cpp:333:23: error: 'current_exception' is not a member of 'std'
2024-09-03 10:27:59 +03:00
René Ferdinand Rivera Morell
ad121dbed0 Add support for modular build structure. (#172)
This is part of the effort to make the Boost libraries "modular" for build and consumption. See https://lists.boost.org/Archives/boost/2024/01/255704.php and https://github.com/grafikrobot/boost-b2-modular/blob/b2-modular/README.adoc for more information.
2024-09-01 17:23:26 +03:00
Jaroslaw Pelczar
981e37c218 Fix type conversions errors reported by GCC (#175)
This commit fixes errors when compiling with:
 -Wall -Werror -Wextra -Wconversion -Wsign-conversion

Signed-off-by: Jarosław Pelczar <jarek@jpelczar.com>
2024-09-01 17:22:07 +03:00
Antony Polukhin
cbf0df774d Fix addr2line work when the process is looked up via PATH.
Fixes #72
boost-1.86.0.beta1 boost-1.86.0
2024-07-07 20:30:51 +03:00
Peter Dimov
34e56c4e90 Do not define BOOST_STACKTRACE_DYN_LINK when BOOST_STACKTRACE_STATIC_LINK is defined 2024-06-23 20:36:49 +03:00
Peter Dimov
f32bd5a543 Define BOOST_STACKTRACE_LINK when BOOST_STACKTRACE_STATIC_LINK is defined. Refs #169. 2024-06-21 23:01:57 +03:00
Peter Dimov
79fc075655 Revert "Disable static linking in GHA because of https://github.com/boostorg/stacktrace/issues/169"
This reverts commit 274aeaa351.
2024-06-21 22:58:47 +03:00
Peter Dimov
6624a0aaeb Remove RelWithDebInfo from posix-cmake-test, because it fails under macos-14 2024-06-21 21:59:41 +03:00
Peter Dimov
ca76415503 Set CMAKE_BUILD_TYPE in posix-cmake-test 2024-06-21 21:53:32 +03:00
Peter Dimov
4352901d19 Move tests to their own function to ensure two stack frames 2024-06-21 21:42:05 +03:00
Peter Dimov
2820ed36b5 Change Windows jobs from Release to RelWithDebInfo 2024-06-21 20:09:21 +03:00
Peter Dimov
1a389747a3 Change test/CMakeLists.txt to use Boost::stacktrace 2024-06-21 20:01:34 +03:00
Peter Dimov
1db160d566 Change cmake_subdir_test and cmake_install_test to use Boost::stacktrace 2024-06-21 19:59:27 +03:00