aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug
AgeCommit message (Collapse)Author
2025-11-20update deprecated ArrayListUnmanaged usage (#25958)Benjamin Jurk
2025-11-20std.debug.MachOFile: handle 'path/to/archive.a(entry.o)' formMatthew Lugg
2025-11-20fuzzer: account for runtime address slideMatthew Lugg
This is relevant to PIEs, which are notably enabled by default on macOS. The build system needs to only see virtual addresses, that is, those which do not have the slide applied; but the fuzzer itself naturally sees relocated addresses (i.e. with the slide applied). We just need to subtract the slide when we communicate addresses to the build system.
2025-11-20std.debug.Info: basic Mach-O supportMatthew Lugg
2025-11-20std.debug: split up Mach-O debug info handlingMatthew Lugg
Like ELF, we now have `std.debug.MachOFile` for the host-independent parts, and `std.debug.SelfInfo.MachO` for logic requiring the file to correspond to the running program.
2025-11-14represent Mac Catalyst as aarch64-maccatalyst-none rather than ↵Alex Rønne Petersen
aarch64-ios-macabi Apple's own headers and tbd files prefer to think of Mac Catalyst as a distinct OS target. Earlier, when DriverKit support was added to LLVM, it was represented a distinct OS. So why Apple decided to only represent Mac Catalyst as an ABI in the target triple is beyond me. But this isn't the first time they've ignored established target triple norms (see: armv7k and aarch64_32) and it probably won't be the last. While doing this, I also audited all Darwin OS prongs throughout the codebase and made sure they cover all the tags.
2025-11-12std.debug: allow fp unwind from contextMatthew Lugg
It's easy to do FP unwinding from a CPU context: you just report the captured ip/pc value first, and then unwind from the captured fp value. All this really needed was a couple of new functions on the `std.debug.cpu_context` implementations so that we don't need to rely on `std.debug.Dwarf` to access the captured registers. Resolves: #25576
2025-11-10Merge pull request #25886 from alexrp/kvxAlex Rønne Petersen
beginnings of KVX target support (via CBE)
2025-11-10std.debug.Dwarf: add kvx ip/fp/sp register mappingsAlex Rønne Petersen
2025-11-10std.debug.cpu_context: add kvx context implementationAlex Rønne Petersen
2025-11-09posix: reduce the number of assumptions made by `dl_iterate_phdr`Jacob Young
Not yet fully compatible with the new linker, but still progress. Closes #25786
2025-10-31fix typo in std.debug.ElfFile.loadSeparateDebugFileTibboddiT
closes #25667
2025-10-30std.debug.cpu_context: fix signal_ucontext_t for arm-linuxAlex Rønne Petersen
2025-10-30Merge pull request #25733 from GasInfinity-Forks/x86_16-cpu_contextAlex Rønne Petersen
* fix: add `i86` cpu in `update_cpu_features` * feat: add `x86_16` debug `cpu_context`
2025-10-29feat: add `x86_16` debug `cpu_context`GasInfinity
2025-10-29std.debug.SelfInfo.Windows: less invasive changeAndrew Kelley
restores code closer to master branch in hopes of avoiding a regression that was introduced when this was based on openSelfExe rather than GetModuleFileNameExW.
2025-10-29std.Io: introduce openSelfExeAndrew Kelley
2025-10-29std.debug.SelfInfo: add missing io parameter to getSymbolAndrew Kelley
2025-10-29std: fix compilation errors on WindowsAndrew Kelley
2025-10-29std.fs: use BadPathName rather than InvalidWtf8 on WindowsAndrew Kelley
2025-10-29std: fix macos compilation errorsAndrew Kelley
2025-10-29std: fix seekBy unit testAndrew Kelley
2025-10-29std.Io: implement fileStatAndrew Kelley
2025-10-29std: updating to std.Io interfaceAndrew Kelley
got the build runner compiling
2025-10-27remove all Oracle Solaris supportAlex Rønne Petersen
There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.
2025-10-26std.debug.cpu_context: fix mcontext alignment for x86_64-illumosAlex Rønne Petersen
It contains a upad128_t array which increases its alignment.
2025-10-25std.debug.cpu_context: add missing signal_ucontext_t fields for ↵Stephen Gregoratto
x86_64-solaris/illumos
2025-10-23std.debug.cpu_context: add signal_ucontext_t for alpha, hppa, microblaze, shAlex Rønne Petersen
2025-10-23std.Target: add arceb and xtensaeb Cpu.Arch tagsAlex Rønne Petersen
2025-10-18std.debug.cpu_context.Sparc: fix bad use of call delay slotAlex Rønne Petersen
2025-10-18std.debug.cpu_context: let the compiler deal with clobbersAlex Rønne Petersen
Otherwise we might be restoring registers we don't even need to.
2025-10-18std.debug.cpu_context: sort context decls according to switch prongs (NFC)Alex Rønne Petersen
2025-10-18std.debug: add CPU context and DWARF mappings for arcAlex Rønne Petersen
2025-10-18std.debug: add CPU context and DWARF mappings for m68kAlex Rønne Petersen
2025-10-18std.debug: add CPU context and DWARF mappings for or1kAlex Rønne Petersen
2025-10-18std.debug: add CPU context and DWARF mappings for cskyAlex Rønne Petersen
2025-10-18std.debug: add CPU context and DWARF mappings for lanaiAlex Rønne Petersen
2025-10-18std.debug: add CPU context and DWARF mappings for veAlex Rønne Petersen
2025-10-15std.debug.Dwarf: add SPARC register number mappingsAlex Rønne Petersen
2025-10-15std.debug.cpu_context: add sparc*-linux context conversion supportAlex Rønne Petersen
It's not really a ucontext_t at all. Lovely stuff.
2025-10-15std.debug.cpu_context.Sparc: flush register windows in current()Alex Rønne Petersen
It's better to do this here than in StackIterator.init() so that std.debug.cpu_context.Native.current() isn't a footgun on SPARC.
2025-10-15std.debug.cpu_context: add Sparc contextAlex Rønne Petersen
2025-10-15std.debug.SelfInfo.Elf: don't support DWARF unwinding for Hexagon and PowerPCAlex Rønne Petersen
As for SPARC, FP-based unwinding is superior on these.
2025-10-12std.debug.cpu_context: consider arm and aarch64 reserved register ranges ↵Alex Rønne Petersen
unsupported If these ever get allocated, it's most likely going to be for things that don't matter to us anyway, so completely abandoning DWARF unwinding just because we see these doesn't seem justified. We will still do so if we're actually asked to read from such a register, which is the only actually problematic case; see c23a5ccd19 for more details.
2025-10-10std.debug.Dwarf.SelfUnwinder: assume same-value rule by default for all columnsAlex Rønne Petersen
This fixes leaf function unwinding, presumably among other things.
2025-10-10std.debug: greatly expand target support for segfault handling/unwindingAlex Rønne Petersen
I made a couple of decisions for this based on the fact that we don't expose the signal_ucontext_t type outside of the file: * Adding all the floating point and vector state to every ucontext_t and mcontext_t variant was way, way too much work, especially when we don't even use the stuff. So I deleted all that and kept only the bare minimum needed to reach into general-purpose registers. * There is no particularly compelling reason to stick to the naming and struct nesting used in the system headers. So we can actually unify the access patterns for almost all of these variants by taking some liberties here; as a result, fromPosixSignalContext() is now much nicer to read and extend.
2025-10-08Merge pull request #25493 from alexrp/std-debug-mips-ppcAlex Rønne Petersen
`std.debug`: MIPS and PowerPC unwind support + some other stuff
2025-10-07std.debug.cpu_context: make arch-specific implementations privateAlex Rønne Petersen
2025-10-07std.debug.SelfInfo.MachO: don't restore vector registers during unwindingAlex Rønne Petersen
We know that these are unsupported and irrelevant for unwinding, so don't fail the unwind attempt trying to read/write them for no ultimate purpose.
2025-10-07std.debug.Dwarf.expression: fix a test that assumes sp != fpAlex Rønne Petersen
This does not hold on PowerPC.