-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
ea9917d
debug: support loading elf debug info from external files
kcbanner f6148f1
add CommonInformationEntry parser
kcbanner 6c1d1aa
begin working on parsing unwind info
kcbanner 8b8d627
- add call frame instruction parser
kcbanner 38303d7
add VirtualMachine to run CFA instructions
kcbanner f3f3c87
- add DWARF expression parser
kcbanner 338df86
- fix remember_state
kcbanner 7b4611c
- move writing code to zig-dwarfdump
kcbanner a0a40c2
- implement more opcodes
kcbanner 69399fb
- add default register rule
kcbanner b449d98
- rework StackIterator to optionally use debug_info to unwind the stack
kcbanner 9145ff7
dwarf: implement more register number mappings
kcbanner e72e762
dwarf: implement more register mappings, fix up macos compile
kcbanner c98e03f
- rework CFI instruction parsing to not use std.meta
kcbanner a325d7f
fmt and cleanup
kcbanner d1a9bb1
debug: fixup context detection for wasi
kcbanner d74c8ac
dwarf: fixup for sort changes
kcbanner 2f75d20
debug: use an explicit context type instead of anytype for dumpStackT…
kcbanner 551f153
dwarf: fixes for non-64 bit systems
kcbanner 5ebca43
debug: fixing more compile errors on arches that I hadn't tested on yet
kcbanner 865d4d2
debug: more fixups for mips linux not having ucontext_t
kcbanner dd20357
debug: fix memory leak when an error occurs opening a pdb file
kcbanner 5781016
dwarf: add support for .eh_frame_hdr when unwinding
kcbanner adbc5bb
dwarf: fixup pointer cast
kcbanner a47212c
- rebase and update to lastest master
kcbanner 5219882
add more safety checks when searching for eh_frame entries using find…
kcbanner 84a1244
dwarf: use eh_frame length if it's available
kcbanner 6abf1fb
update to new builtin syntax
kcbanner 41832aa
linux: add getcontext for x86_64
kcbanner a9b6f2d
dwarf: add support for .debug_frame and CIE version 4
kcbanner 5cd8ab2
debug: enhance writeCurrentStackTrace to use context-based unwinding …
kcbanner 89ef004
debug: x86 unwinding support, more unwinding fixes
kcbanner caa3347
linux: rework getcontext to closer match the specification (saved IP/…
kcbanner f991b9d
debug: fix reading -gdwarf generated debug sections in COFF files
kcbanner 23d9b59
c: add getcontext
kcbanner 9c908ea
test: add standalone test for DWARF unwinding with -fomit-frame-pointer
kcbanner 7bc1695
c: musl doesn't implement getcontext, so defer to our implementation …
kcbanner ccc9f82
c: fixup getcontext
kcbanner 6a5e2b7
debug: de-duplicate some code in macos ModuleDebugInfo
kcbanner 395ab47
dwarf: fix logic error in eh_frame_hdry binary search
kcbanner f04f970
dwarf: add support for DWARF5 DW_AT_ranges in subprograms, add DebugR…
kcbanner 62598c2
debug: rework how unwind errors are printed, and add module name look…
kcbanner b85f840
dwarf: don't dupe function names, as they are backed by the memory ma…
kcbanner 412cd78
debug: fixup base address calculations for macho
kcbanner 576ffaa
darwin: update mcontext_t definition for aarch64 to add neon state
kcbanner ad5f74c
dwarf: introduce ExpressionContext, add more expression opcodes
kcbanner 424b129
dwarf: add expression writer
kcbanner 8547c42
dwarf: expression fixups for non-64bit arches, check call_frame_conte…
kcbanner 5f72c65
debug: rename StackTraceContext to ThreadContext
kcbanner 463bbe7
dwarf: implement constx,addrx, begin adding DWARF expression tests
kcbanner 5c0d4ce
debug: add dupeContext, store a pointer to a copy of ThreadContext on…
kcbanner 54ca62f
dwarf: fixup regBytes for the case where there is no context support
kcbanner 021f537
dwarf: fixup default endianness in ExpressionOptions, add control flo…
kcbanner 21d0154
dwarf: skip register tests on unimplemented arch / os, add tests for …
kcbanner d226b74
dwarf: add ExpressionError to work around the compiler not being able…
kcbanner 94354aa
macho: add unwindFrame which can unwind stack frames using the __unwi…
kcbanner 203d96a
debug: add relocateContext
kcbanner 5dfb159
macho: add aarch64 implementation to unwindFrame
kcbanner 891fa3b
debug: fix initialization of the optional fields on StackIterator
kcbanner e5aa2bb
debug: fixup last_error being printed too many times
kcbanner 9b25bee
debug: fixup have_getcontext
kcbanner b180313
dwarf: use cie.return_address_register instead of assuming it's in th…
kcbanner 06bf2e0
tests: use a more portable way of determining the return address in t…
kcbanner 9549b4a
debug: fixup an inconsistency in the getcontext implementation on aa…
kcbanner 7d8b423
macho: remove unnecessary checks
kcbanner ec96095
compilation: pass omit_frame_pointer through to builtin.zig
kcbanner ba813d0
dwarf: add abi.stripInstructionPtrAuthCode
kcbanner 5e399d9
use eh_frame from the mapped binary if available
kcbanner 618b0eb
dwarf: fixup integer overflow in readEhPointer
kcbanner 2c76020
debug: load the macho unwind sections from the already-mapped image
kcbanner bdb0a6f
test: add a test for dwarf embedded in coff
kcbanner 774dc2f
dwarf: add explicit_fde_offset to support more optimal __unwind_info …
kcbanner 97bda56
macho: don't scan all eh_frame entries, instead follow the offset fro…
kcbanner 1a2bb70
dwarf: write the CFA as SP before the register update, in case the SP…
kcbanner d99b40d
dwarf: fix the unwinder using the incorrect row from the FDE in certa…
kcbanner 2bc2b01
dwarf: update the pc register
kcbanner 4421b14
dwarf: fixup rules for setting ip
kcbanner 253e697
dwarf: implement aarch64 default register rules
kcbanner 6d87bb3
debug: disable the new unwinder on aarch64-macos
kcbanner 8e6a62b
test: disable omit_frame_pointer unwinding tests on aarch64-macos
kcbanner b1d86db
dwarf: move macho unwind code from macho -> dwarf
kcbanner File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this usingnamespace. Just put the definition here and let the linker tell the user that the symbol does not exist. The user should do this logic themselves if they want to reach into Linux directly.
This is the
std.c
namespace after all, it should not pretend to be libc and then do something else.