Commit Graph

48 Commits

Author SHA1 Message Date
Jeremy Rifkin
4c59e73a01
Split up cpptrace.hpp 2024-10-05 18:01:12 -05:00
Vittorio Romeo
0ddbbf43cb
Improve compilation times on Windows (#172)
Thank you for the very useful library!

Few improvements:
- Better header hygiene
- Isolate `windows.h` to `.cpp` whenever possible
- Use `WIN32_LEAN_AND_MEAN`
- Remove unused headers

Tested on Windows with 
```
cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 
  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-ftime-trace -Wall -Wextra -Wpedantic 
  -Wno-ignored-attributes" -DCMAKE_COLOR_DIAGNOSTICS=1 -DCPPTRACE_BUILD_TESTING=1 
  -DCPPTRACE_BUILD_BENCHMARKING=0
```

There's a lot more that can be improved if you are interested.

---------

Co-authored-by: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com>
2024-10-02 10:55:13 -05:00
Jeremy Rifkin
164cc75681
A little refactoring and reorganization. Remove relative includes. 2024-08-18 11:58:49 -05:00
Jeremy Rifkin
b3836e9318
Support -Wpedantic if someone sets the flag globally while using FetchContent (#127)
Closes #107
2024-05-23 21:18:11 -05:00
Jeremy
ab63c34827
Replace most stream use with new formatting system 2024-03-30 20:25:06 -05:00
Jeremy
d17fe33abf
Try to fix build errors 2024-02-27 00:39:58 -06:00
Jeremy
9113cc5ffc
Some refactoring, bring object_frame in line with safe_object_frame. Also renamed address_relative_to_object_base_in_memory. 2023-11-20 23:13:21 -06:00
Jeremy
2a4a8066d3
Rework the object trace interface a bit and clarify their purpose. Also rename minimal_object_trace to safe_object_trace 2023-11-20 23:01:19 -06:00
Jeremy
327a6e8318
Fix two more includes 2023-11-18 23:42:49 -06:00
Jeremy
0e462c7b03
Some restructuring of the directory layout 2023-11-18 23:28:48 -06:00
Jeremy
ae5d2392fe
More std:: 2023-10-08 22:48:12 -04:00
Jeremy Rifkin
ddad92b1f8
Sonar fixes (#52) 2023-10-05 11:17:39 -04:00
Jeremy Rifkin
183cdf5a1c
Error handling improvements (#46) 2023-09-23 17:46:26 -04:00
Jeremy Rifkin
76fc93639e
Properly handle dwarf errors (#43) 2023-09-22 19:54:56 -04:00
Jeremy
a31fe3dc00
Make stacktrace_frame an aggregate again 2023-09-19 15:36:34 -04:00
Jeremy
799e7a7705
Remove clang-tidy 2023-09-19 15:26:51 -04:00
Jeremy
5c3df2571e
Rename stacktrace_frame.col to column, set a proper sentinel value, and update stacktrace.to_string to not have a tailing newline 2023-09-19 15:17:39 -04:00
Jeremy Rifkin
0b32df64e4
Expand cpptrace API (#37) 2023-09-18 20:33:46 -04:00
Jeremy
5e4e842704
Refactor frame collation from addr2line 2023-09-16 21:54:44 -04:00
Jeremy
fdbc69e18e
Refactor nested namespaces 2023-09-16 21:19:08 -04:00
Jeremy
278ee3fcee
Work on improving error handling and some general refactoring. Also trying to bring everything into cpptrace::detail. 2023-09-16 20:46:30 -04:00
Jeremy
a862f3d2c8
More thoroughly use -fullPath for atos on macos 2023-09-12 02:38:33 -04:00
Jeremy
70bc51d371
Use -fullPath for atos on macos 2023-09-12 02:07:24 -04:00
Jeremy
5dc819186e
Baseline for middle-end system 2023-09-11 11:57:01 -04:00
Jeremy
0e27da8c11
Some symbol backend refactoring, get rid of pimpl nonsense 2023-08-31 01:21:22 -04:00
Jeremy Rifkin
6ed6e623ed
Initial work to add libdwarf as a back-end (#24) 2023-08-30 12:14:17 -04:00
Jeremy
d72e30af12
Fix paths with spaces 2023-08-27 21:46:16 -04:00
Jeremy
6ede6f6f53
Make the linter happy (for real x2) 2023-08-27 21:34:15 -04:00
Jeremy
fb258f0671
Handle empty addr2line input 2023-08-27 20:54:34 -04:00
Jeremy
0977253505
Address fopen errors 2023-08-27 20:46:00 -04:00
Jeremy Rifkin
72228ab5e8
Changes to handle elf image bases / text link-at addresses (#21)
Figure out the text offset for elf files. When testing on a system that
did not use ASLR by default a user found addr2line being invoked with
the wrong addresses.
2023-07-24 21:51:52 -04:00
Jeremy
d589f2a609
Fix for addr2line edge case 2023-07-24 18:49:34 -04:00
Jeremy Rifkin
43383228e7
Bake an absolute path for addr2line into the library to prevent against path injection (#19) 2023-07-23 23:01:20 -04:00
Jeremy
0e701903ed
Refactor PE header parsing out of addr2line code 2023-07-23 19:58:58 -04:00
Jeremy Rifkin
d12cd313d3
Cache expensive computations (#18) 2023-07-23 19:05:11 -04:00
Jeremy
ec3bb29200
Remove old printbug statement 2023-07-23 17:49:32 -04:00
Jeremy
b246613045
Thread safety 2023-07-23 17:29:43 -04:00
Jeremy
55b5d8a488
File name refactor 2023-07-23 11:18:43 -04:00
Jeremy Rifkin
75df02f7a3
Fix bug in the test ci script (#15) 2023-07-23 10:24:28 -04:00
Jeremy Rifkin
baf785cc49
Macos addr2line / atos support (#14) 2023-07-23 09:27:01 -04:00
Jeremy
00d6f1c9d1
Update how stacktraces are printed, add color, add a demo program, add a screenshot to the readme, and two small fixes to backends 2023-07-22 21:50:23 -04:00
Jeremy Rifkin
d7a5eb54fd
Add baseline mingw support (#13) 2023-07-21 22:33:56 -04:00
Jeremy Rifkin
04f8b88efd
Some CI and cmake changes (#9) 2023-07-18 22:21:56 -04:00
Jeremy Rifkin
8e4ee0783f
Various macos work (#7) 2023-07-14 08:35:17 -04:00
Jeremy Rifkin
d955c61cd6
Try to add basic performance testing (#8) 2023-07-13 21:54:17 -04:00
Jeremy
57f5cc529c
Use _exit() over exit() 2023-07-09 21:50:39 -04:00
Jeremy Rifkin
6d9d2a9747
Add addr2line back-end (#5) 2023-07-09 21:10:53 -04:00
Jeremy
b3474b50c3
Initial commit 2023-07-01 17:06:41 -04:00