Commit Graph

499 Commits

Author SHA1 Message Date
Jeremy
fdf4499259
Update docs to showcase source code snippets 2024-03-16 23:31:07 -05:00
Jeremy
c5138e2f40
Add nominmax for windows.h 2024-03-16 19:34:16 -05:00
Jeremy
a841a1b74a
Fix msvc warning treated as error 2024-03-16 19:23:03 -05:00
Jeremy
8407adf6d3
Add print_with_snippets to docs 2024-03-16 17:52:38 -05:00
Jeremy
a528aa8e0b
Fix object address resolution with _dl_find_object, #104 2024-03-16 16:17:27 -05:00
Jeremy
92be6c23f1
Update note about debug symbols being needed 2024-03-15 17:39:23 -05:00
Jeremy
6a8ff75fc1
Merge branch 'main' into dev 2024-03-09 22:26:17 -06:00
Jeremy
c35392d20b
Fix comment 2024-03-09 22:25:51 -06:00
Jeremy
754c588464
Disable CE button temporarily 2024-03-09 22:25:04 -06:00
Jeremy
3e0689a5e6
Resolve object address for dbghelp frames by default, handles #100 2024-03-09 22:15:41 -06:00
Jeremy
8d6326da07
Update locking in dbghelp_syminit_manager 2024-03-08 17:39:08 -06:00
Jeremy
c896d70f79
Small reorganization 2024-03-05 17:47:55 -06:00
Adrien Cassagne
d8e23c1e93
Add 'POSITION_INDEPENDENT_CODE ON' (also known as '-fPIE'). (#99)
First thx for these very useful lib!

I encountered some issues when linking with `libcpptrace`. Typically,
here is the error I got:
```
/usr/bin/ld: lib/cpptrace/lib/libcpptrace.a(cpptrace.cpp.o): relocation R_X86_64_32S against symbol `_ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE@@GLIBCXX_3.4.21' can not be used when making a PIE object; recompile with -fPIE
```
I just added the `POSITION_INDEPENDENT_CODE ON` flag on the targets, and
now it works like a charm :-).
2024-03-05 08:57:04 -06:00
Jeremy
3054b3bebd
Add tmp to gitignore 2024-03-03 14:37:14 -06:00
Jeremy
da739d30c5
Add can_signal_safe_unwind and update some documentation surrounding signal-safe stack tracing 2024-03-03 12:15:27 -06:00
Jeremy
ec264aa0eb
Cleanup and improve snippet code a bit 2024-03-03 11:49:15 -06:00
Jeremy
862b546532
Update margin handling 2024-03-03 11:34:09 -06:00
Jeremy
9da2b3f556
Refactor object.hpp, separate out module base logic which greatly cleans things up 2024-03-03 11:31:06 -06:00
Jeremy
f11e119d32
Refactor stacktrace conversion code 2024-03-03 10:54:23 -06:00
Jeremy
389f788b57
Add get_object_info method to stacktrace frames, adding onto the previous work for #97 2024-03-03 10:54:03 -06:00
Jeremy
123e7df4f4
Mention CPPTRACE_STATIC_DEFINE for non-cmake instructions 2024-02-28 23:32:48 -06:00
Jeremy
42a91af570
Remove some completed features from the todo list 2024-02-28 23:30:45 -06:00
Jeremy Rifkin
d99f1745d2
Basic source code snippet system (#98) 2024-02-28 23:29:24 -06:00
Jeremy
736643358b
Implement a non-recursive get_inlines_info 2024-02-28 22:30:47 -06:00
Jeremy
055e0d94cf
Use ccache if possible, at top-level 2024-02-28 22:09:54 -06:00
Jeremy
0fda4a88ed
Refactor stack trace frame printing 2024-02-28 20:53:28 -06:00
Jeremy
58992cbeb6
Bump to 0.4.1 2024-02-27 22:53:59 -06:00
Jeremy
a700b7f7ef
Update documentation for stacktrace_frames 2024-02-27 22:53:16 -06:00
Jeremy
c6a60f7172
Stratify test ci 2024-02-27 20:10:35 -06:00
Jeremy
76aff1c30e
Revert "Try something fancy"
This reverts commit df8b8eb4c8.
2024-02-27 19:55:42 -06:00
Jeremy
df8b8eb4c8
Try something fancy 2024-02-27 19:54:06 -06:00
Jeremy
6e01f7225d
Try to rework ci to test first the default configuration, then test all configs after that passes. Also refactor the build in all tests script. 2024-02-27 19:51:52 -06:00
Jeremy
e0b50c96b4
Refactor out prerequisite setup to scripts in ci/ 2024-02-27 19:41:34 -06:00
Jeremy
a31d35c04e
Fixes 2024-02-27 19:12:55 -06:00
Jeremy
a24c140baf
Add object address resolution for libdl backend 2024-02-27 19:00:08 -06:00
Jeremy
d17fe33abf
Try to fix build errors 2024-02-27 00:39:58 -06:00
Jeremy
3c7a677689
Add an object address to stacktrace_frame entries, addresses #97 (no pun intended) 2024-02-27 00:34:45 -06:00
Jeremy
d5b2646283
Merge branch 'main' into dev 2024-02-27 00:23:10 -06:00
Jeremy
fc770a764e
Small readme fix 2024-02-27 00:22:50 -06:00
Jeremy
b7d14bc952
Only deal with zstd if not using CPPTRACE_USE_EXTERNAL_LIBDWARF 2024-02-19 16:46:48 -06:00
Jeremy
a162423800
Update conan config to not use nested dwarf header path 2024-02-19 10:39:07 -06:00
Bruce Mitchener
f879cd8b7b
README: improve text about macOS and dsymutil (#93)
According to the release notes, I think this is true ... if not,
disregard!
2024-02-19 02:11:33 -06:00
Bruce Mitchener
a144002bf0
Tweaks from clang-tidy (#92)
This is (perhaps) mainly for discussion as I saw you removed
`clang-tidy` checks last year. These fix a variety of minor things.

With one of the options that I was using, these still remain:

```
/Users/bruce/Development/custodian/cpptrace/src/symbols/../utils/utils.hpp:235:22: warning: noexcept specifier on the move constructor evaluates to 'false' [performance-noexcept-move-constructor]
  235 |             noexcept(std::is_nothrow_move_constructible<T>::value)
      |                      ^
/Users/bruce/Development/custodian/cpptrace/src/symbols/../utils/utils.hpp:250:64: warning: noexcept specifier on the move assignment operator evaluates to 'false' [performance-noexcept-move-constructor]
  250 |             noexcept(std::is_nothrow_move_assignable<T>::value && std::is_nothrow_move_constructible<T>::value)
      |                                                                ^
```
2024-02-18 11:21:48 -06:00
Bruce Mitchener
1488460172
Use defined(CPPTRACE_HAS_CXX_EXCEPTION_TYPE). (#94)
This is set by the build system when it is available and not set when
not available (and not set to 1/0 respectively).

The current code can generate a warning when this preprocessor
definition is not defined.
2024-02-18 11:16:04 -06:00
Bruce Mitchener
9296b892ac
ci: Update ilammy/msvc-dev-cmd to 1.13 from 1.10. (#91)
This should remove most of the warnings about using older versions of
NodeJS.
2024-02-18 10:48:12 -06:00
Bruce Mitchener
aa446b0540
Fix typos. (#90) 2024-02-18 00:10:21 -06:00
ethanol20924
c3b38381ab
Small fix to allow for compiling with Homebrew installed Clang on Mac (#89)
When building with Clang installed with Homebrew:

```
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/opt/llvm/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
```

I get the following error:

```
/opt/homebrew/opt/llvm/bin/llvm-ranlib: error: Invalid option: '-no_warning_for_no_symbols'
make[2]: *** [_deps/zstd-build/lib/libzstd.a] Error 1
make[2]: *** Deleting file `_deps/zstd-build/lib/libzstd.a'
make[1]: *** [_deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/all] Error 2
make: *** [all] Error 2
```

If I instead build with AppleClang:

```
-- The C compiler identification is AppleClang 15.0.0.15000100
-- The CXX compiler identification is AppleClang 15.0.0.15000100
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
```

It works as expected.

Source of the problem is found at `CMakeLists.txt:282`:

```CMake
if(APPLE)
  SET(CMAKE_C_ARCHIVE_FINISH   "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
  SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
```

Changing it to check specifically for AppleClang appears to fix the
problem for me:

```CMake
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
  SET(CMAKE_C_ARCHIVE_FINISH   "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
  SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
```
2024-02-16 11:28:38 -06:00
Jeremy
d52b80301a
Make sure to at least show object frame info even if resolution fails for libdwarf, resolves #87
Co-authored-by: eyalgolan1337
2024-02-15 19:40:11 -06:00
Leandro SQ
8d2728d0f0
fix: Broken link on README.md (#88)
This pull request includes a minor change to the `README.md` file. The
change updates the link to the `signal-safe-tracing.md` file, moving it
into the `docs` directory.
2024-02-15 12:36:28 -06:00
Jeremy
3cd8e92e66
Handle copying libcpptrace.dll better for findpackage integration 2024-02-12 22:14:03 -06:00