Jeremy Rifkin
8f2193f35a
Fix handling of strtab in a code path in the elf code
2025-02-13 23:47:16 -06:00
Jeremy Rifkin
2b7d47d627
Add elf symtab dumping tool
2025-02-02 21:37:22 -06:00
Jeremy Rifkin
9077430b6a
Search both the elf symbol table and dynamic symbol table
2025-01-28 23:40:08 -06:00
Jeremy Rifkin
06c9c14995
Return an optional from lookup_symbol
2025-01-28 23:26:28 -06:00
Jeremy Rifkin
7f6945c7d9
Better handle symtab loading / optionality
2025-01-28 23:14:37 -06:00
Jeremy Rifkin
73ee7aa3a1
Don't try to load string table if strtab_link is SHN_UNDEF or the symbol table is empty
2025-01-28 22:21:43 -06:00
Jeremy Rifkin
dc0c683804
Remove elf::byteswap_if_needed's little endian parameter
2025-01-27 23:49:27 -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
68c9d33e94
Use tried_to_load_header
2025-01-26 23:22:03 -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
b705afba69
Templated lambdas aren't a thing in C++11 :(
2025-01-26 14:52:31 -06:00
Jeremy Rifkin
485d9a6f21
A little elf refactoring, separate out header loading
2025-01-24 20:16:46 -06:00
Jeremy Rifkin
d063784abc
Refactor elf_get_module_image_base, setup an elf class in preparation for more elf parsing
2025-01-23 00:12:31 -06:00
Jeremy Rifkin
f152788abd
Merge branch 'main' into dev
2024-10-29 22:23:28 -05:00
Pavol Gono
9269a72c54
Fixed compiler warnings and errors under MSYS2+MINGW64 platform. ( #186 )
...
Fixed compiler warnings and errors under MSYS2+MINGW64 platform.
2024-10-27 10:30:36 -05:00
Jeremy Rifkin
a1fa0a1b81
Use forward declaration header in object.hpp
2024-10-06 16:50:39 -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
4f94f20d41
Fix computation of object address for safe object frames. I forgot to do this as part of a528aa8e0b, also related to #104
2024-09-07 12:02:52 -05:00
Jeremy Rifkin
64e0210449
Better handle resolution of safe object frames with empty object paths
2024-08-18 13:38:06 -05:00
Jeremy Rifkin
164cc75681
A little refactoring and reorganization. Remove relative includes.
2024-08-18 11:58:49 -05:00
Jeremy
1f19c31e02
Fix bug with dladdr1 not being used, silly typo
2024-06-19 15:15:51 -05:00
Jeremy
dad3bd1843
Some comments regarding dlfcn logistics and comment cleanup
2024-05-25 00:40:08 -05:00
Jeremy
7916f10278
Attempt to fallback to dladdr if dladdr1 is not available
2024-05-24 23:04:20 -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
da0aa4d5c0
Split a bunch of internal headers into .cpp/.hpp
2024-05-05 17:44:27 -05:00
Jeremy
abbc77dcea
Clean up logic a bit
2024-05-02 11:17:41 -05:00
Jeremy
d3c7e7351c
Remove guard for resolve_l_name
2024-05-02 11:09:37 -05:00
Jeremy
ce19421bb5
Update for macos
2024-05-02 11:05:22 -05:00
Jeremy
b125248b32
Update dladdr path to not use dli_fname as it's unreliable in the case of a non-standard argv[0]
2024-05-02 10:47:31 -05:00
Jeremy
0dd71cebb7
Mac fixes
2024-03-31 22:01:14 -05:00
Jeremy
ffb1b8ed68
A little more error handling cleanup
2024-03-31 16:02:39 -05:00
Jeremy
dc9cee98fb
Move error when returning
2024-03-31 15:52:45 -05:00
Jeremy
124607e7bf
Resolve some TODOs with error handling for mach-o stuff
2024-03-31 15:24:01 -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
a528aa8e0b
Fix object address resolution with _dl_find_object, #104
2024-03-16 16:17:27 -05:00
Jeremy
c896d70f79
Small reorganization
2024-03-05 17:47:55 -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
389f788b57
Add get_object_info method to stacktrace frames, adding onto the previous work for #97
2024-03-03 10:54:03 -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
9a7c45bda7
remove return that wasn't needed
2024-02-11 02:05:00 -06:00
Jeremy
cdaab64be2
Revert "Printbug"
...
This reverts commit 2e9c586ba7 .
2024-02-11 01:58:29 -06:00
Jeremy
612d5e6d65
Fix architecture handling in load_mach
2024-02-11 01:53:57 -06:00
Jeremy
2e9c586ba7
Printbug
2024-02-11 01:49:46 -06:00
Jeremy
37630f479d
Try to make fat mach architecture handling more robust
2024-02-08 00:38:56 -06:00
Jeremy
59272bccd6
printbug...
2024-02-07 22:37:55 -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
3a0db500d0
Fixes
2023-11-21 21:32:42 -06:00
Jeremy
64a60f227d
Resolve a couple compilation warnings
2023-11-21 12:11:16 -06:00
Jeremy
e889fa7acf
Use dlfo_link_map->l_addr over dlfo_map_start
2023-11-21 09:41:56 -06:00