Commit Graph

173 Commits

Author SHA1 Message Date
Jeremy
da0aa4d5c0
Split a bunch of internal headers into .cpp/.hpp 2024-05-05 17:44:27 -05:00
Jeremy
93b1d1c76a
Add basic unittest 2024-05-04 22:34:25 -05:00
Jeremy
f8ebdd26be
Small test refactor 2024-05-04 11:52:45 -05:00
Jeremy
d7c19a5544
Updates for conda 2024-05-03 20:07:09 -05:00
Jeremy
0db934caf7
Bump to 0.5.4 2024-05-02 11:30:54 -05:00
Jeremy
14d25fd89a
Bump to v0.5.3 and update changelog 2024-04-29 23:12:53 -05:00
Jeremy
db0738332e
Bump libdwarf 2024-04-28 19:58:43 -05:00
Jeremy
c1b7be9f83
Bump to v0.5.2 2024-03-31 16:19:27 -05:00
Jeremy
b72164b39b
Bump to v0.5.1 2024-03-20 22:12:26 -05:00
Jeremy
2985cb1d6c
Merge branch 'main' into dev 2024-03-16 23:31:57 -05:00
Jeremy
c5138e2f40
Add nominmax for windows.h 2024-03-16 19:34:16 -05:00
Jeremy
9b69d200c1
Bump to v0.5.0 2024-03-16 18:03:34 -05: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 Rifkin
d99f1745d2
Basic source code snippet system (#98) 2024-02-28 23:29:24 -06:00
Jeremy
055e0d94cf
Use ccache if possible, at top-level 2024-02-28 22:09:54 -06:00
Jeremy
58992cbeb6
Bump to 0.4.1 2024-02-27 22:53:59 -06:00
Jeremy
d5b2646283
Merge branch 'main' into dev 2024-02-27 00:23:10 -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
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
7fda402638
Bump to 0.4.0 2024-02-11 12:41:21 -06:00
Jeremy
bc662438f3
Small cmake adjustments 2024-02-11 11:53:33 -06:00
Jeremy
df6e02087e
Update for vcpkg 2024-02-07 22:08:45 -06:00
Jeremy
60dd6b5065
Fix issues related to export directives 2024-02-07 21:40:52 -06:00
Jeremy
adefa5c234
Bump libdwarf hashes and use the lightweight mirror 2024-02-07 21:34:41 -06:00
Jeremy
5e65ccecc0
Add external zstd option 2024-02-04 14:35:49 -06:00
Jeremy
c161293e89
Update for zstd target handling again 2024-02-04 00:17:25 -06:00
Jeremy
ab9a832a30
Try to get some updated libdwarf/zstd handling 2024-02-04 00:00:12 -06:00
Jeremy Rifkin
a65aed2752
Aquire zstd with fetchcontent for libdwarf 9 (#85) 2024-02-01 00:14:48 -06:00
Jeremy
5fde4081dc
Replace the cmake generated export header 2024-01-29 23:26:18 -06:00
Jeremy
b1ff59b59c
Update ctrace demo to be a .c 2024-01-29 23:18:21 -06:00
Jeremy Rifkin
79931c8823
Parsing of mach-o symbol tables, generation of debug maps, and resolution through object files (#82) 2024-01-29 22:12:59 -06:00
eightfold
218957dfb0
New C api (#80)
Updated C API following the requested scheme. May implement "exceptions"
later...

Closes #38

---------

Co-authored-by: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com>
2024-01-23 00:16:20 -06:00
Jeremy
3d74da8df1
Turn on -Werror for CI pipelines 2024-01-14 23:42:15 -06:00
Jeremy
2100723312
Another attempt to resolve libdwarf header issues 2024-01-14 19:56:11 -06:00
Jeremy
399e52f460
Try again to fix libdwarf #includes 2024-01-14 15:23:02 -06:00
Jeremy
5d64a98d08
Handle libdwarf's sporadic header placement better 2024-01-14 03:11:33 -06:00
Jeremy
4743e95988
Merge branch 'main' into dev 2024-01-14 02:53:59 -06:00
Jeremy
7720df748a
Updates to urls and tags for libdwarf 2024-01-14 02:53:35 -06:00
hades
965505e465
fix locating libunwind without pkgconfig (#76)
The call to find_path used an incorrect variable name, that wasn't
included in the target_include_directories call.
2024-01-13 13:18:25 -06:00
Jeremy
ca76080968
Updates to better support external libdwarf, because nothing about how libdwarf's cmake is setup is consistent 2024-01-13 01:31:10 -06:00
Jeremy
aa5315769e
Handle color arguments better if C and C++ compiler families differ 2023-12-06 00:16:24 -05:00
Jeremy
ab389c36bd
Bump to 0.3.1 2023-12-03 13:27:58 -05:00
Jeremy
4ec11d00de
Bump versions to 0.3.0 2023-11-22 19:54:18 -06:00
Jeremy
594dd720b4
Update setup for finding and linking libunwind stuff 2023-11-21 23:22:15 -06:00
Jeremy
728ec2cb40
Add another link for vcpkg 2023-11-21 22:44:13 -06:00
Jeremy
a106bc4680
Use libdwarf::libdwarf on conan 2023-11-21 15:17:38 -06:00
Jeremy
cd59ab5478
Added signal tracing demo 2023-11-19 23:46:49 -06:00
Jeremy
4a9b24b31b
Only build signal tracer on unix 2023-11-19 23:27:27 -06:00
Jeremy
24e64ab385
Check for _dl_find_object support 2023-11-19 23:17:11 -06:00
Jeremy
ac13e71877
Implement signal-safe resolution of basic object information 2023-11-19 22:49:58 -06:00
Jeremy
8297d234f6
Use an optimized mirror for libdwarf 2023-11-13 11:48:15 -05:00
Jeremy
b28cb54ced
Rename demo/test options to CPPTRACE_BUILD_TESTING 2023-11-13 10:44:50 -05:00
Jeremy Rifkin
5541ec5519
Add libunwind back-end (#62) 2023-11-12 17:15:59 -05:00
Jeremy
259d596f76
Re-enable warnings 2023-11-08 23:59:48 -05:00
Jeremy
f21874cbf7
Use CMAKE_DL_LIBS 2023-11-07 10:44:42 -05:00
Jeremy
f4a71c2d23
Some small cmake fixes 2023-11-06 22:37:47 -05:00
Jeremy
01ac14ba92
Try another way to set no_warning_for_no_symbols 2023-11-06 17:18:57 -05:00
Jeremy
cd9d29bf2b
Suppress ranlib "has no symbols" warnings 2023-11-06 17:14:54 -05:00
Jeremy
3489ed1f72
Fix 2023-11-06 16:51:18 -05:00
Jeremy
d0bc2526e7
try again 2023-11-06 15:57:26 -05:00
Jeremy
046b23f3a1
Try again 2023-11-06 15:54:57 -05:00
Jeremy
faea88265d
Bump 2023-11-06 15:44:19 -05:00
Jeremy
781c30f63f
Fix build 2023-11-06 15:16:33 -05:00
Jeremy Rifkin
e717930f5d
Unbundle libdwarf (#58)
Pending #57
2023-11-06 13:04:58 -05:00
Jeremy Rifkin
98368fb417
CMake improvements (#57) 2023-11-06 12:12:07 -05:00
Jeremy
ad4f9c4060
Make CPPTRACE_USE_SYSTEM_LIBDWARF non-advanced 2023-11-01 11:54:25 -04:00
Jeremy
41ab5fdb7e
Add bindir change back in 2023-10-08 22:06:43 -04:00
Jeremy
5bbadbf5b2
Revert "Try bindir, might revert"
This reverts commit ff8f761a2b.
2023-10-08 22:03:14 -04:00
Jeremy
ff8f761a2b
Try bindir, might revert 2023-10-08 14:58:05 -04:00
Jeremy
05c3f7160b
Add specialized terminate handler and add error handling info to the README. Also updated demo. 2023-10-07 17:34:49 -04:00
Jeremy
3143181612
Bump version and make changelog notes 2023-10-06 01:03:12 -04:00
Jeremy
58130d7ed2
Remove old check 2023-10-04 20:15:15 -04:00
Jeremy
cd4fa0dd0c
Remove HAS_ADDR2LINE check 2023-10-04 18:49:33 -04:00
Jeremy
435b3cd001
Small fixes 2023-10-04 18:23:19 -04:00
Jeremy
22bba739bd
Don't try to export dwarf if not using dwarf 2023-10-04 16:05:04 -04:00
Jeremy
b690d3805d
Add stackwalk64 check/fallback 2023-10-04 15:44:39 -04:00
Jeremy
262f024332
Don't try to install dwarf target 2023-10-04 15:13:29 -04:00
Jeremy
e28cda9a35
Remove -Wnonnull-compare, it's included in -Wall 2023-10-04 12:05:06 -04:00
Jeremy
bbcd8db054
Better handle PIC / static linking 2023-10-04 10:27:03 -04:00
Jeremy
556d7fe33d
Use StackWalk64 for mingw and cleanup checks performed in cmake 2023-09-29 13:10:21 -04:00
Jeremy Rifkin
6de61e7755
Add StackWalk64 backend (#48) 2023-09-24 17:30:56 -04:00
Jeremy
edf55395d7
Cleanup CPPTRACE_USE_SYSTEM_LIBDWARF and add note to the README. TODO for some reason the include path still doesn't work. 2023-09-24 03:49:56 -04:00
Jeremy
0620197285
Add winapi demangling 2023-09-19 11:03:45 -04:00
Jeremy
5fc39fbcea
Small change: Log demangler config 2023-09-18 19:24:51 -04:00
Jeremy
640aeadf91
Remove full tracing options 2023-09-18 14:37:27 -04:00
Jeremy Rifkin
6dac6da7b3
Refactor how the speedtest is built (#35) 2023-09-17 23:12:03 -04:00
Jeremy
e068a3dadd
Add static option and overhaul README a bit 2023-09-12 23:59:10 -04:00
Jeremy
8bcd2491ee
Bump minimum cmake version to 3.5 2023-09-12 18:09:14 -04:00
Jeremy
ffe5fa2524
Fix cmake issue - work around weird bug with parsing the URL 2023-09-12 13:02:54 -04:00
Jeremy
c7f6f76f54
Fix cmake warning 2023-09-12 01:31:40 -04:00
Jeremy
2545e6c2e5
Use .dSYM files on macos. Should fix test cases. 2023-09-12 01:19:58 -04:00
Jeremy
e16f88817e
Use both dbghelp and libdwarf under mingw 2023-09-11 12:06:16 -04:00
Jeremy
5dc819186e
Baseline for middle-end system 2023-09-11 11:57:01 -04:00
Jeremy
b4d8fda9e2
Update libdwarf cmake 2023-09-01 13:09:05 -04:00
Jeremy
e3cba004b7
Bundle libdwarf 2023-09-01 13:00:45 -04:00
Jeremy
871344f7ae
Some cmake cleanup 2023-08-31 01:08:06 -04:00
Jeremy Rifkin
6ed6e623ed
Initial work to add libdwarf as a back-end (#24) 2023-08-30 12:14:17 -04:00
Jeremy
4b11b87e4d
Update cmake_minimum_required 2023-07-29 11:30:07 -04:00
Jeremy Rifkin
7989209e5b
Support older cmake (#23) 2023-07-25 18:51:27 -04:00