Commit Graph

268 Commits

Author SHA1 Message Date
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
cfdd311e15
Fix warning for gcc on windows 2024-01-14 23:51:41 -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
e8c857d6c2
Small tweak for a couple aggregate initializations 2024-01-14 22:27:25 -06:00
Jeremy
2100723312
Another attempt to resolve libdwarf header issues 2024-01-14 19:56:11 -06:00
Jeremy
3e46d2a570
Fix typo 2024-01-14 18:05:31 -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
56b50d279a
Update msvc bug workaround to not produce build warnings 2023-12-04 11:30:37 -05:00
Jeremy
6db9794dc6
Workaround a msvc bug affecting msvc 19.38 2023-12-03 21:33:31 -05: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
Jeremy
0ee29d0855
Use CPPTRACE_PATH_MAX more consistently, and another small refactor 2023-11-20 23:37:49 -06:00
Jeremy
87cd24438b
Use _dl_find_object over dladdr when possible in object resolution, it's so much faster 2023-11-20 23:36:55 -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
7c49e64ba6
Updated documentation, added documentation for new stuff, and updated cpptrace.hpp a bit 2023-11-20 22:14:13 -06:00
Jeremy
6c6d915414
Removed raw_trace::from_buffer, not happy with that api 2023-11-19 23:45:51 -06:00
Jeremy
0b48df7f22
Fix windows build warning 2023-11-19 23:20:31 -06:00
Jeremy
24e64ab385
Check for _dl_find_object support 2023-11-19 23:17:11 -06:00
Jeremy
ac7db48cef
Really fix it this time 2023-11-19 23:07:41 -06:00
Jeremy
f4237c75df
Try to fix build 2023-11-19 22:54:08 -06:00
Jeremy
16ec7c5855
Fix oversight, demangle in object_trace resolution 2023-11-19 22:52:43 -06:00
Jeremy
ac13e71877
Implement signal-safe resolution of basic object information 2023-11-19 22:49:58 -06:00
Jeremy
327a6e8318
Fix two more includes 2023-11-18 23:42:49 -06:00
Jeremy
88319b13a7
Turns out one of the includes was needed 2023-11-18 23:39:59 -06:00
Jeremy
6da8ee0773
Fix a couple includes 2023-11-18 23:38:03 -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
77a2e3a22b
Rework the exception interface 2023-11-18 09:00:57 -06:00
Jeremy
0de366f7d6
Add column support for libdwarf 2023-11-15 22:50:10 -05:00
Jeremy
140166a4a7
Updated nested exception what message 2023-11-15 21: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
ab7e71f1b2
Add exception wrapping utilities, will help issues like #60 2023-11-15 21:24:26 -05:00
Jeremy
61d536bc02
Put noinline macro in header 2023-11-15 15:22:59 -05:00
Jeremy
520962162c
Improvement for trace printing with missing symbols or filenames 2023-11-15 15:10:22 -05:00
Jeremy
79bc580519
Handle multiple symbol back-ends better 2023-11-15 15:09:08 -05:00
Jeremy
fec5324502
Fix 2023-11-15 12:50:37 -05:00
Jeremy
f6468b7a01
Update _Unwind to not rely on a hard max frames 2023-11-15 12:48:01 -05:00
Jeremy
15572b029d
Bump hard max frames from 100 to 200 2023-11-15 12:47:36 -05:00
Jeremy
0084de0f05
Some tweaks and fixes 2023-11-15 12:17:18 -05:00
Jeremy
feef9a3265
Fix 2023-11-15 11:55:59 -05:00
Jeremy
aed456bc63
Handle null lines / columns better 2023-11-15 11:52:24 -05:00
Jeremy
c6ea891629
Address -Wmissing-field-initializers warnings 2023-11-14 22:58:10 -05:00
Jeremy
96a55fc686
Fix windows build, and prevent future warnings 2023-11-12 23:42:26 -05:00
Jeremy
e80afd460b
Add safe tracing interface 2023-11-12 23:31:41 -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
4c1c42c61d
Add frame_ptr alias 2023-11-08 21:32:34 -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
1ced7c8dc3
Minor tweaks 2023-11-08 19:41:13 -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
93de7b7060
spacing fix 2023-11-07 00:05:50 -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
Jeremy
fef039ba26
Setup a lookup table for line info 2023-11-06 22:38:21 -05:00
Jeremy
781c30f63f
Fix build 2023-11-06 15:16:33 -05:00
Jeremy Rifkin
98368fb417
CMake improvements (#57) 2023-11-06 12:12:07 -05:00
Jeremy
ae5d2392fe
More std:: 2023-10-08 22:48:12 -04:00
Jeremy
ae484f0ed2
Improve terminate handler behavior when there's no active exception and also try to print a trace for non-cpptrace terminates 2023-10-08 14:55:21 -04:00
Jeremy
f6f64954de
Sonar suggestion 2023-10-07 17:43:39 -04:00
Jeremy
1d514c1532
Windows fix 2023-10-07 17:42:11 -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
2e0fa880bc
Small fixes 2023-10-07 15:05:50 -04:00
Jeremy
8bb8a2020c
Add some utilities for exception handling and detecting whether stderr is a terminal 2023-10-07 14:59:04 -04:00
Jeremy
df6c22f640
Sonar fix 2023-10-07 14:04:29 -04:00
Jeremy
4d2580185f
Sonar fixes 2023-10-07 13:59:57 -04:00
Jeremy
a422e132d4
Comments and sonar fixes 2023-10-07 13:43:39 -04:00
Jeremy Rifkin
b26c5e4ec8
Refactor cpptrace exception objects and simplify interface (#54) 2023-10-06 20:25:30 -04:00
Jeremy
bda3e2b169
Fix for msvc 2023-10-06 01:23:46 -04:00
Jeremy
2b1a2c7a19
Fix useless cast warning 2023-10-06 00:53:40 -04:00
Jeremy
2f507cc24d
Fix msvc build 2023-10-05 12:55:44 -04:00
Jeremy
0c03ac7a01
Refactor stacktrace::print 2023-10-05 12:41:52 -04:00
Jeremy
c3a27d15fb
Update trace objects to just be aggregates 2023-10-05 12:33:43 -04:00
Jeremy
53ceb99b46
Sonar fixes: More nullptr literal use, take std::fuction by const&, and [[noreturn]] 2023-10-05 12:08:47 -04:00
Jeremy
af181bf981
Disabled on sonar 2023-10-05 11:16:55 -04:00
Jeremy
1b9e5916f6
Some fixes 2023-10-05 11:07:46 -04:00
Jeremy
12b80f7af1
Some fixes 2023-10-05 11:01:03 -04:00
Jeremy
3b5064f1ff
Fix forwarding issue 2023-10-05 10:58:03 -04:00
Jeremy
435b3cd001
Small fixes 2023-10-04 18:23:19 -04:00
Jeremy
4324901cd1
Fix stackwalk64 architecture detection 2023-10-04 15:31:59 -04:00
Jeremy
3cdcc847c9
Fix gcc 5 2023-10-04 14:30:17 -04:00
Jeremy
15b2f36934
Update warning supression 2023-10-04 13:14:21 -04:00
Jeremy
81b2e46df1
Support stackwalk64 for 32-bit x86 2023-10-04 13:13:48 -04:00
Jeremy
b80026596f
Some warning fixes 2023-10-04 13:09:45 -04:00
Jeremy
b236da4a0b
Patch for compilation on 32-bit msvc 2023-10-02 17:30:06 -04:00
Jeremy
909ce8155f
Remove some old junk from the universal mach-o bodge 2023-10-02 11:01:21 -04:00
Jeremy Rifkin
fcd0dcc62b
Adjust program counters for execinfo and capturestackbacktrace too (#50) 2023-10-02 11:00:13 -04:00
Jeremy
b46ebe7f54
Update libdwarf code to remove fat mach-o bodge and properly handle fat mach-o files 2023-09-30 19:28:35 -04:00
Jeremy
d4bc913607
Setup global dwarf_resolver cache for dwarf resolving 2023-09-30 03:37:16 -04:00
Jeremy
e82f6e360f
Two small refactors 2023-09-30 03:36:07 -04:00
Jeremy
d964842bdb
Refactor some helper functions and wrappers for dawrf into another file 2023-09-29 15:13:35 -04:00
Jeremy
d84a3167d9
Add cache mode config 2023-09-29 12:50:47 -04:00
Jeremy
93dde93802
Caching and optimization work for dwarf 2023-09-29 11:09:17 -04:00