Commit Graph

107 Commits

Author SHA1 Message Date
Jeremy Rifkin
daed105fef
Cache elf and mach-o file objects 2025-02-19 22:49:55 -06:00
Jeremy Rifkin
06c9c14995
Return an optional from lookup_symbol 2025-01-28 23:26:28 -06:00
Jeremy Rifkin
08306c12a5
Implement symbol table lookup for mach-o and fix mingw build 2025-01-27 23:12:30 -06:00
Jeremy Rifkin
8edb419342
Implement elf symbol table parsing and fall back to the elf symbol table during symbol resolution 2025-01-26 23:07:33 -06:00
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
8d7a85c447
Update flatten_inlines to properly move inline frames instead of copying them and also clarify a comment 2024-06-04 23:21:14 -05:00
Infko
72b0e467d7
fix compile error in gcc 4.8.5. (#133) 2024-06-04 23:16:34 -05:00
Jeremy
810b74ecaa
Refactor symbols_with_libdwarf indo separate files 2024-05-25 14:29:55 -05:00
Jeremy
5171e87a51
Refactor logic in the libdwarf resolver's resolve_frames, pull out trace flattening 2024-05-25 13:38:06 -05:00
Jeremy
a9f72c6f67
Refactor logic in the libdwarf resolver's resolve_frames, pull out resolver management 2024-05-25 13:02:25 -05:00
Jeremy
da0aa4d5c0
Split a bunch of internal headers into .cpp/.hpp 2024-05-05 17:44:27 -05:00
Jeremy
124607e7bf
Resolve some TODOs with error handling for mach-o stuff 2024-03-31 15:24:01 -05:00
Jeremy
50483783cb
Fix bug with non-recursive inline walking 2024-03-30 23:18:55 -05:00
Jeremy Rifkin
acaa4f42e6
Add a Result type and replace some exceptions with it (#109) 2024-03-30 13:35:52 -05:00
Jeremy
736643358b
Implement a non-recursive get_inlines_info 2024-02-28 22:30:47 -06:00
Jeremy
a31d35c04e
Fixes 2024-02-27 19:12:55 -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
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
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
Jeremy
22b326ba7e
Small optimization, doesn't really matter but doesn't hurt 2024-02-11 22:22:29 -06:00
Jeremy
e6627b760d
Implement better logic for handling scrfile indices, related to #86 2024-02-11 21:02:48 -06:00
Jeremy
cb92c9fdfa
Small optimization to reduce unnecessary frame copying 2024-02-11 15:59:56 -06:00
Jeremy
36a16df075
Handle an edge case with dwarf file indices, identified in #86 2024-02-11 15:25:18 -06:00
Jeremy
d7aac52f8b
Add configuration to control resolution of inlined calls 2024-02-04 11:03:03 -06:00
Jeremy
b8c66cd855
Remove old comment 2024-01-29 22:29:35 -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
Jeremy Rifkin
a654f2082e
Mach-o refactoring (#77)
This is the first step towards a more comprehensive mach-o system. Next
step will be to add support for symbol table parsing.
2024-01-14 23:36:30 -06:00
Jeremy
399e52f460
Try again to fix libdwarf #includes 2024-01-14 15:23:02 -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
e8fd01bbe1
Fallback to the cu cache or walking cu's if aranges lookup fails 2023-12-06 00:21:44 -05: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
88319b13a7
Turns out one of the includes was needed 2023-11-18 23:39:59 -06:00
Jeremy
5657a07ed4
Remove some no longer needed includes 2023-11-18 23:35:43 -06:00
Jeremy
0e462c7b03
Some restructuring of the directory layout 2023-11-18 23:28:48 -06:00
Jeremy
0de366f7d6
Add column support for libdwarf 2023-11-15 22:50:10 -05:00
Jeremy
a518cd8874
Walk subprogram children to handle lambdas better and also cast better 2023-11-15 21:30:11 -05:00
Jeremy
79bc580519
Handle multiple symbol back-ends better 2023-11-15 15:09:08 -05:00
Jeremy
aed456bc63
Handle null lines / columns better 2023-11-15 11:52:24 -05:00
Jeremy
259d596f76
Re-enable warnings 2023-11-08 23:59:48 -05:00
Jeremy
7929d239bd
Create a cache for CU srcfiles 2023-11-08 20:47:29 -05:00
Jeremy
2f8e1a5ff7
More work to get inline resolution going 2023-11-08 19:46:31 -05:00
Jeremy
6fbedd0ed6
Commend out prints 2023-11-08 14:59:53 -05:00
Jeremy
5bf66156cd
Minor fixes 2023-11-08 14:47:15 -05:00
Jeremy
7ffec7b3c0
Inital work to walk inline tree and show inlined calls 2023-11-08 13:05:39 -05:00
Jeremy
6d62936c7b
cache path and line number 2023-11-07 00:05:32 -05:00
Jeremy
9096531e23
Either LUT or walk for line info based on cache mode 2023-11-06 23:20:11 -05:00