Commit Graph

26 Commits

Author SHA1 Message Date
kcbanner
412cd789bf 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
2023-07-20 22:58:14 -04:00
kcbanner
b85f84061a dwarf: don't dupe function names, as they are backed by the memory mapped sections
dwarf: const-correctness fixups
dwarf: implement the remaining register rules
dwarf: start implmenting the DWARF expression stack machine
2023-07-20 22:58:14 -04:00
kcbanner
f04f9705cc dwarf: add support for DWARF5 DW_AT_ranges in subprograms, add 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-20 22:58:14 -04:00
kcbanner
89ef004646 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
2023-07-20 22:58:14 -04:00
kcbanner
6abf1fbfe6 update to new builtin syntax 2023-07-20 22:58:14 -04:00
kcbanner
a47212c72e - rebase and update to lastest master 2023-07-20 22:58:13 -04:00
kcbanner
5781016c35 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
2023-07-20 22:58:13 -04:00
kcbanner
5ebca4392e debug: fixing more compile errors on arches that I hadn't tested on yet 2023-07-20 22:58:13 -04:00
kcbanner
551f153718 dwarf: fixes for non-64 bit systems 2023-07-20 22:58:13 -04:00
kcbanner
a325d7f6d1 fmt and cleanup 2023-07-20 22:58:13 -04:00
kcbanner
c98e03fc7e - rework CFI instruction parsing to not use std.meta
- move register formatting code to zig-dwardump
2023-07-20 22:58:13 -04:00
kcbanner
e72e762d1e dwarf: implement more register mappings, fix up macos compile 2023-07-20 22:58:13 -04:00
kcbanner
9145ff7da0 dwarf: implement more register number mappings
- add dwarf.abi.RegisterContext to handle register numbers changing based on DWARF format
2023-07-20 22:58:13 -04:00
kcbanner
b449d98a93 - rework StackIterator to optionally use debug_info to unwind the stack
- add abi routines for getting register values
- unwding is working!
2023-07-20 22:58:13 -04:00
kcbanner
69399fbb82 - add default register rule
- fixup eh pointer decoding
2023-07-20 22:58:13 -04:00
kcbanner
a0a40c2e7e - implement more opcodes 2023-07-20 22:58:13 -04:00
kcbanner
7b4611cfb3 - move writing code to zig-dwarfdump
- implement restore_state, restore_extended, offset_extended
2023-07-20 22:58:13 -04:00
kcbanner
338df862d1 - fix remember_state
- implement def_cfa_register
2023-07-20 22:58:13 -04:00
kcbanner
f3f3c877e0 - add DWARF expression parser
- change read apis to use a stream
- add register formatters
2023-07-20 22:58:13 -04:00
kcbanner
38303d7b9c add VirtualMachine to run CFA instructions 2023-07-20 22:58:13 -04:00
kcbanner
8b8d627137 - add call frame instruction parser
- add register printing
2023-07-20 22:58:13 -04:00
kcbanner
6c1d1aa45c begin working on parsing unwind info 2023-07-20 22:58:13 -04:00
kcbanner
f6148f123e add CommonInformationEntry parser 2023-07-20 22:58:12 -04:00
Luuk de Gram
33b2f4f382 wasm: Implement debug info for parameters 2022-05-09 18:51:46 +02:00
William Sengir
6de8b4bc3d std.dwarf: implement basic DWARF 5 parsing
DWARF 5 moves around some fields and adds a few new ones that can't be
parsed or ignored by our current DWARF 4 parser. This isn't a complete
implementation of DWARF 5, but this is enough to make stack traces
mostly work. Line numbers from C++ don't show up, but I know the info
is there. I think the answer is to iterate through .debug_line_str in
getLineNumberInfo, but I didn't want to fall into an even deeper rabbit
hole tonight.
2022-03-15 16:53:45 -04:00
Andrew Kelley
c05a20fc8c std: reorganization that allows new usingnamespace semantics
The proposal #9629 is now accepted, usingnamespace stays but no longer
puts identifiers in scope.
2021-09-01 17:54:06 -07:00