-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DWARF unwinding, and an external debug info loader for ELF #15823
Commits on Jul 21, 2023
-
debug: support loading elf debug info from external files
Some distributions (ie. Ubuntu) have their libc debug info in separate files. This change allows the stack walking code to read that debug info. - add support for reading compressed ELF sections - support reading the build-id from the elf headers in order to lookup external debug info - support reading the .gnu_debuglink section to look up external debug info
Configuration menu - View commit details
-
Copy full SHA for ea9917d - Browse repository at this point
Copy the full SHA ea9917dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6148f1 - Browse repository at this point
Copy the full SHA f6148f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c1d1aa - Browse repository at this point
Copy the full SHA 6c1d1aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b8d627 - Browse repository at this point
Copy the full SHA 8b8d627View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38303d7 - Browse repository at this point
Copy the full SHA 38303d7View commit details -
- change read apis to use a stream - add register formatters
Configuration menu - View commit details
-
Copy full SHA for f3f3c87 - Browse repository at this point
Copy the full SHA f3f3c87View commit details -
Configuration menu - View commit details
-
Copy full SHA for 338df86 - Browse repository at this point
Copy the full SHA 338df86View commit details -
- move writing code to zig-dwarfdump
- implement restore_state, restore_extended, offset_extended
Configuration menu - View commit details
-
Copy full SHA for 7b4611c - Browse repository at this point
Copy the full SHA 7b4611cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a0a40c2 - Browse repository at this point
Copy the full SHA a0a40c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69399fb - Browse repository at this point
Copy the full SHA 69399fbView commit details -
- rework StackIterator to optionally use debug_info to unwind the stack
- add abi routines for getting register values - unwding is working!
Configuration menu - View commit details
-
Copy full SHA for b449d98 - Browse repository at this point
Copy the full SHA b449d98View commit details -
dwarf: implement more register number mappings
- add dwarf.abi.RegisterContext to handle register numbers changing based on DWARF format
Configuration menu - View commit details
-
Copy full SHA for 9145ff7 - Browse repository at this point
Copy the full SHA 9145ff7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e72e762 - Browse repository at this point
Copy the full SHA e72e762View commit details -
- rework CFI instruction parsing to not use std.meta
- move register formatting code to zig-dwardump
Configuration menu - View commit details
-
Copy full SHA for c98e03f - Browse repository at this point
Copy the full SHA c98e03fView commit details -
Configuration menu - View commit details
-
Copy full SHA for a325d7f - Browse repository at this point
Copy the full SHA a325d7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d1a9bb1 - Browse repository at this point
Copy the full SHA d1a9bb1View commit details -
Configuration menu - View commit details
-
Copy full SHA for d74c8ac - Browse repository at this point
Copy the full SHA d74c8acView commit details -
debug: use an explicit context type instead of anytype for dumpStackT…
…raceFromBase, update crash_report to use this for exceptions
Configuration menu - View commit details
-
Copy full SHA for 2f75d20 - Browse repository at this point
Copy the full SHA 2f75d20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 551f153 - Browse repository at this point
Copy the full SHA 551f153View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ebca43 - Browse repository at this point
Copy the full SHA 5ebca43View commit details -
debug: more fixups for mips linux not having ucontext_t
- increase test-std max_rss to 1.1 above the CI observed amount
Configuration menu - View commit details
-
Copy full SHA for 865d4d2 - Browse repository at this point
Copy the full SHA 865d4d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd20357 - Browse repository at this point
Copy the full SHA dd20357View commit details -
dwarf: add support for .eh_frame_hdr when unwinding
- .eh_frame_hdr contains a binary-searchable data structure for finding an FDE. If present, we can use this section to avoid having to parse the entire FDE/CIE list in the binary, instead only entries that are actually required for unwinding are read. - rework the inputs pc-relative pointer decoding to support both already-mapped sections as well as sections mapped from a file - store the VirtualMachine on UnwindContext so the allocations can be reused
Configuration menu - View commit details
-
Copy full SHA for 5781016 - Browse repository at this point
Copy the full SHA 5781016View commit details -
Configuration menu - View commit details
-
Copy full SHA for adbc5bb - Browse repository at this point
Copy the full SHA adbc5bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for a47212c - Browse repository at this point
Copy the full SHA a47212cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5219882 - Browse repository at this point
Copy the full SHA 5219882View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84a1244 - Browse repository at this point
Copy the full SHA 84a1244View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6abf1fb - Browse repository at this point
Copy the full SHA 6abf1fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41832aa - Browse repository at this point
Copy the full SHA 41832aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for a9b6f2d - Browse repository at this point
Copy the full SHA a9b6f2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cd8ab2 - Browse repository at this point
Copy the full SHA 5cd8ab2View commit details -
debug: x86 unwinding support, more unwinding fixes
- Fix unwindFrame using the previous FDE row instead of the current one - Handle unwinding through noreturn functions - Add x86-linux getcontext - Fixup x86_64-linux getcontext not restoring the fp env - Fix start_addr filtering on x86-windows
Configuration menu - View commit details
-
Copy full SHA for 89ef004 - Browse repository at this point
Copy the full SHA 89ef004View commit details -
linux: rework getcontext to closer match the specification (saved IP/…
…SP match the state after it would return) debug: fixup ucontext_t check
Configuration menu - View commit details
-
Copy full SHA for caa3347 - Browse repository at this point
Copy the full SHA caa3347View commit details -
debug: fix reading -gdwarf generated debug sections in COFF files
I had accidentally regressed support for -gdwarf in 461fb49 when I changed the logic to use the already-mapped exe/dll image instead of loading it from disk. The string table is mapped as all zeroes by the loader, so if a section header's name is longer than 8 bytes (like the ones generated by -gdwarf), then the name can't be read. Now, if any section headers require the string table, the file is mapped from disk. windows: Add NtCreateSection/NtMapViewOfSection/NtUnmapViewOfSection
Configuration menu - View commit details
-
Copy full SHA for f991b9d - Browse repository at this point
Copy the full SHA f991b9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 23d9b59 - Browse repository at this point
Copy the full SHA 23d9b59View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c908ea - Browse repository at this point
Copy the full SHA 9c908eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bc1695 - Browse repository at this point
Copy the full SHA 7bc1695View commit details -
debug: supports_context -> have_ucontext, supports_getcontext -> have_getcontext test: rework dwarf_unwind test case to also test the non-libc path
Configuration menu - View commit details
-
Copy full SHA for ccc9f82 - Browse repository at this point
Copy the full SHA ccc9f82View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a5e2b7 - Browse repository at this point
Copy the full SHA 6a5e2b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 395ab47 - Browse repository at this point
Copy the full SHA 395ab47View commit details -
dwarf: add support for DWARF5 DW_AT_ranges in subprograms, add DebugR…
…angeIterator Some DWARF5 subprograms have non-contiguous instruction ranges. An example of such a function is `puts` in Ubuntu's libc. This change fixes name lookups for functions that use DW_AT_range in their DIE.
Configuration menu - View commit details
-
Copy full SHA for f04f970 - Browse repository at this point
Copy the full SHA f04f970View commit details -
debug: rework how unwind errors are printed, and add module name look…
…up for linux This change enhances stack trace output to include a note that debug info was missing, and therefore the stack trace may not be accurate. For example, if the user is using a libc compiled with -fomit-frame-pointer and doesn't have debug symbols installed, any traces that begin in a libc function may not unwind correctly. This allows the user to notice this and potentially install debug symbols to improve the output.
Configuration menu - View commit details
-
Copy full SHA for 62598c2 - Browse repository at this point
Copy the full SHA 62598c2View commit details -
dwarf: don't dupe function names, as they are backed by the memory ma…
…pped sections dwarf: const-correctness fixups dwarf: implement the remaining register rules dwarf: start implmenting the DWARF expression stack machine
Configuration menu - View commit details
-
Copy full SHA for b85f840 - Browse repository at this point
Copy the full SHA b85f840View commit details -
debug: fixup base address calculations for macho
dwarf: fixup x86 register mapping logic dwarf: change the register context update to update in-place instead of copying debug: always print the unwind error type
Configuration menu - View commit details
-
Copy full SHA for 412cd78 - Browse repository at this point
Copy the full SHA 412cd78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 576ffaa - Browse repository at this point
Copy the full SHA 576ffaaView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad5f74c - Browse repository at this point
Copy the full SHA ad5f74cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 424b129 - Browse repository at this point
Copy the full SHA 424b129View commit details -
dwarf: expression fixups for non-64bit arches, check call_frame_conte…
…xt when writing expressions
Configuration menu - View commit details
-
Copy full SHA for 8547c42 - Browse repository at this point
Copy the full SHA 8547c42View commit details -
debug: rename StackTraceContext to ThreadContext
dwarf: use ThreadContext instead of os.ucontext_t dwarf: add regBytes impl for windows dwarf: fixup expression types for non-native
Configuration menu - View commit details
-
Copy full SHA for 5f72c65 - Browse repository at this point
Copy the full SHA 5f72c65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 463bbe7 - Browse repository at this point
Copy the full SHA 463bbe7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c0d4ce - Browse repository at this point
Copy the full SHA 5c0d4ceView commit details -
dwarf: fixup regBytes for the case where there is no context support
expressions: add more tests, fix tests for mipsel debug: add lookupModuleName implementation for macos
Configuration menu - View commit details
-
Copy full SHA for 54ca62f - Browse repository at this point
Copy the full SHA 54ca62fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 021f537 - Browse repository at this point
Copy the full SHA 021f537View commit details -
dwarf: skip register tests on unimplemented arch / os, add tests for …
…type convesions debug: dupeContext -> copyContext
Configuration menu - View commit details
-
Copy full SHA for 21d0154 - Browse repository at this point
Copy the full SHA 21d0154View commit details -
dwarf: add ExpressionError to work around the compiler not being able…
… to infer it dwarf: implement OP.entry_value, add tests
Configuration menu - View commit details
-
Copy full SHA for d226b74 - Browse repository at this point
Copy the full SHA d226b74View commit details -
macho: add unwindFrame which can unwind stack frames using the __unwi…
…nd_info section dwarf: fixup missing error
Configuration menu - View commit details
-
Copy full SHA for 94354aa - Browse repository at this point
Copy the full SHA 94354aaView commit details -
dwarf: fixup tests that used a ThreadContext
Configuration menu - View commit details
-
Copy full SHA for 203d96a - Browse repository at this point
Copy the full SHA 203d96aView commit details -
macho: add aarch64 implementation to unwindFrame
dwarf: map the V registers in abi.regBytes test: add test case that exercises the stack-indirect __unwind_info mode in x86_64
Configuration menu - View commit details
-
Copy full SHA for 5dfb159 - Browse repository at this point
Copy the full SHA 5dfb159View commit details -
debug: fix initialization of the optional fields on StackIterator
dwarf: documentation fixups target: enable unwind tables on macho
Configuration menu - View commit details
-
Copy full SHA for 891fa3b - Browse repository at this point
Copy the full SHA 891fa3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e5aa2bb - Browse repository at this point
Copy the full SHA e5aa2bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b25bee - Browse repository at this point
Copy the full SHA 9b25beeView commit details -
Configuration menu - View commit details
-
Copy full SHA for b180313 - Browse repository at this point
Copy the full SHA b180313View commit details -
Configuration menu - View commit details
-
Copy full SHA for 06bf2e0 - Browse repository at this point
Copy the full SHA 06bf2e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9549b4a - Browse repository at this point
Copy the full SHA 9549b4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d8b423 - Browse repository at this point
Copy the full SHA 7d8b423View commit details -
compilation: pass omit_frame_pointer through to builtin.zig
Renamed dwarf_unwinding -> stack_iterator to better reflect that it's not just DWARF unwinding. Added a test for unwinding with a frame pointer.
Configuration menu - View commit details
-
Copy full SHA for ec96095 - Browse repository at this point
Copy the full SHA ec96095View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba813d0 - Browse repository at this point
Copy the full SHA ba813d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e399d9 - Browse repository at this point
Copy the full SHA 5e399d9View commit details -
dwarf: fixup integer overflow in readEhPointer
debug: handle the possibility of eh_frame / debug_frame being mapped in memory or loaded from disk
Configuration menu - View commit details
-
Copy full SHA for 618b0eb - Browse repository at this point
Copy the full SHA 618b0ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2c76020 - Browse repository at this point
Copy the full SHA 2c76020View commit details -
Configuration menu - View commit details
-
Copy full SHA for bdb0a6f - Browse repository at this point
Copy the full SHA bdb0a6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 774dc2f - Browse repository at this point
Copy the full SHA 774dc2fView commit details -
macho: don't scan all eh_frame entries, instead follow the offset fro…
…m the __unwind_info directly
Configuration menu - View commit details
-
Copy full SHA for 97bda56 - Browse repository at this point
Copy the full SHA 97bda56View commit details -
dwarf: write the CFA as SP before the register update, in case the SP…
… itself is updated by a column rule
Configuration menu - View commit details
-
Copy full SHA for 1a2bb70 - Browse repository at this point
Copy the full SHA 1a2bb70View commit details -
Configuration menu - View commit details
-
Copy full SHA for d99b40d - Browse repository at this point
Copy the full SHA d99b40dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bc2b01 - Browse repository at this point
Copy the full SHA 2bc2b01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4421b14 - Browse repository at this point
Copy the full SHA 4421b14View commit details -
Configuration menu - View commit details
-
Copy full SHA for 253e697 - Browse repository at this point
Copy the full SHA 253e697View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d87bb3 - Browse repository at this point
Copy the full SHA 6d87bb3View commit details -
test: disable omit_frame_pointer unwinding tests on aarch64-macos
dwarf: handle signal frame CIE flag
Configuration menu - View commit details
-
Copy full SHA for 8e6a62b - Browse repository at this point
Copy the full SHA 8e6a62bView commit details -
dwarf: move macho unwind code from macho -> dwarf
dwarf: fixup unchecked .eh_frame CIE offset subtraction
Configuration menu - View commit details
-
Copy full SHA for b1d86db - Browse repository at this point
Copy the full SHA b1d86dbView commit details