aboutsummaryrefslogtreecommitdiff
path: root/lib/std/dwarf.zig
AgeCommit message (Collapse)Author
2024-08-22Dwarf: cleanup emitted debug infoJacob Young
* reduce iteration cost by not tracking unused entries * avoid emitting unused abbrevs to `.debug_abbrev` * get the compiler executable passing `llvm-dwarfdump --verify` * make it possible to skip `.debug_line` padding much more quickly
2024-08-16Dwarf: rework self-hosted debug info from scratchJacob Young
This is in preparation for incremental and actually being able to debug executables built by the x86_64 backend.
2024-08-01std: dwarf namespace reorgAndrew Kelley
std.debug.Dwarf is the parsing/decoding logic. std.dwarf remains the unopinionated types and bits alone. If you look at this diff you can see a lot less redundancy in namespaces.
2024-07-10dwarf: use StackIterator.MemoryAccessor to check memory accesses instead of ↵kcbanner
isValidMemory
2024-06-23Rename *[UI]LEB128 functions to *[UI]leb128Michael Bradshaw
2024-05-11riscv: remove an allocation from `dwarf.zig`David Rubin
2024-03-19extract std.posix from std.osAndrew Kelley
closes #5019
2024-03-14std: make std.dwarf.FixedBufferReader publicLuuk de Gram
Also fixes a compile-error as the field `is_64` no longer exists.
2024-03-10improve documentation in stdAndrew Kelley
A lot of these "shorthand" doc comments were redundant, low quality filler content. Better to let the actual modules speak for themselves with top level doc comments rather than trying to document their aliases.
2024-02-18dwarf: optimize dwarf parsing for speedJacob Young
This code is run when printing a stack trace in a debug executable, so it has to be fast even without compiler optimizations. Adding a `@panic` to the top of `main` and running an x86_64 backend compiled compiler goes from `1m32.773s` to `0m3.232s`.
2023-11-19lib: correct unnecessary uses of 'var'mlugg
2023-10-31mem: fix ub in writeIntJacob Young
Use inline to vastly simplify the exposed API. This allows a comptime-known endian parameter to be propogated, making extra functions for a specific endianness completely unnecessary.
2023-08-06std: remove some unused imports (#16710)Zachary Raineri
2023-07-26target: emit unwind tables if the platform supports unwindingkcbanner
2023-07-25reduce the number of duplicate instantiations due to differing stream parameterskcbanner
2023-07-24switch to sortUnstable when sorting FDEs (~16ms improvement)kcbanner
2023-07-20dwarf: move macho unwind code from macho -> dwarfkcbanner
dwarf: fixup unchecked .eh_frame CIE offset subtraction
2023-07-20test: disable omit_frame_pointer unwinding tests on aarch64-macoskcbanner
dwarf: handle signal frame CIE flag
2023-07-20debug: disable the new unwinder on aarch64-macoskcbanner
2023-07-20dwarf: implement aarch64 default register ruleskcbanner
2023-07-20dwarf: fixup rules for setting ipkcbanner
2023-07-20dwarf: update the pc registerkcbanner
2023-07-20dwarf: fix the unwinder using the incorrect row from the FDE in certain caseskcbanner
2023-07-20dwarf: write the CFA as SP before the register update, in case the SP itself ↵kcbanner
is updated by a column rule
2023-07-20macho: don't scan all eh_frame entries, instead follow the offset from the ↵kcbanner
__unwind_info directly
2023-07-20dwarf: add explicit_fde_offset to support more optimal __unwind_info dwarf ↵kcbanner
lookups
2023-07-20dwarf: fixup integer overflow in readEhPointerkcbanner
debug: handle the possibility of eh_frame / debug_frame being mapped in memory or loaded from disk
2023-07-20dwarf: add abi.stripInstructionPtrAuthCodekcbanner
2023-07-20dwarf: use cie.return_address_register instead of assuming it's in the IP ↵kcbanner
register
2023-07-20debug: fix initialization of the optional fields on StackIteratorkcbanner
dwarf: documentation fixups target: enable unwind tables on macho
2023-07-20macho: add unwindFrame which can unwind stack frames using the __unwind_info ↵kcbanner
section dwarf: fixup missing error
2023-07-20dwarf: add ExpressionError to work around the compiler not being able to ↵kcbanner
infer it dwarf: implement OP.entry_value, add tests
2023-07-20dwarf: skip register tests on unimplemented arch / os, add tests for type ↵kcbanner
convesions debug: dupeContext -> copyContext
2023-07-20dwarf: fixup regBytes for the case where there is no context supportkcbanner
expressions: add more tests, fix tests for mipsel debug: add lookupModuleName implementation for macos
2023-07-20debug: add dupeContext, store a pointer to a copy of ThreadContext on ↵kcbanner
UnwindContext
2023-07-20debug: rename StackTraceContext to ThreadContextkcbanner
dwarf: use ThreadContext instead of os.ucontext_t dwarf: add regBytes impl for windows dwarf: fixup expression types for non-native
2023-07-20dwarf: expression fixups for non-64bit arches, check call_frame_context when ↵kcbanner
writing expressions
2023-07-20dwarf: introduce ExpressionContext, add more expression opcodeskcbanner
2023-07-20debug: fixup base address calculations for machokcbanner
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
2023-07-20dwarf: don't dupe function names, as they are backed by the memory mapped ↵kcbanner
sections dwarf: const-correctness fixups dwarf: implement the remaining register rules dwarf: start implmenting the DWARF expression stack machine
2023-07-20debug: rework how unwind errors are printed, and add module name lookup for ↵kcbanner
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.
2023-07-20dwarf: add support for DWARF5 DW_AT_ranges in subprograms, add ↵kcbanner
DebugRangeIterator 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.
2023-07-20dwarf: fix logic error in eh_frame_hdry binary searchkcbanner
2023-07-20debug: x86 unwinding support, more unwinding fixeskcbanner
- 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
2023-07-20dwarf: add support for .debug_frame and CIE version 4kcbanner
2023-07-20update to new builtin syntaxkcbanner
2023-07-20dwarf: use eh_frame length if it's availablekcbanner
2023-07-20add more safety checks when searching for eh_frame entries using findEntrykcbanner
2023-07-20- rebase and update to lastest masterkcbanner
2023-07-20dwarf: fixup pointer castkcbanner