Commit Graph

306 Commits

Author SHA1 Message Date
Alex Rønne Petersen 7ee6e7d61e std.debug.Dwarf.Unwind.VM: deal with negative offsets in unsigned CFI insns
The DWARF spec has CFI instructions that take signed offsets, but at least LLVM
always emits the unsigned variants, even for e.g. `.cfi_def_cfa_offset -4`.
2026-05-28 04:03:47 +02:00
Alex Rønne Petersen 197ba11787 std.debug.SelfInfo.Elf: update lists of supported architectures 2026-05-27 00:28:15 +02:00
Alex Rønne Petersen 5c64311fab std.debug.cpu_context: add mcontext_t for x86-freebsd 2026-05-27 00:28:00 +02:00
Alex Rønne Petersen 833c6d9792 std.debug.cpu_context: add missing align(16) on x86_64-freebsd mcontext_t 2026-05-27 00:28:00 +02:00
Alex Rønne Petersen 6aa6a07955 std.debug.cpu_context: add mcontext_t for hppa-linux and hppa64-linux 2026-05-27 00:28:00 +02:00
Alex Rønne Petersen 12790e69a7 std.debug.cpu_context: add mcontext_t for hppa-netbsd 2026-05-27 00:27:06 +02:00
Alex Rønne Petersen 7d5e400911 std.debug.cpu_context: sheb-openbsd doesn't exist 2026-05-26 23:30:48 +02:00
Alex Rønne Petersen f3a7a4c5e2 Merge pull request 'NetBSD 11.0 cross libc support' (#35464) from alexrp/zig:netbsd-11 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35464
2026-05-26 20:55:53 +02:00
Carl Åstholm fc3406a961 std.debug.Pdb: deduplicate inline source locations
Previously, if the same inline function was called multiple times
by the same caller, the inline function's frame would be repeated
multiple times, once for each prior call.
2026-05-26 20:37:09 +02:00
Alex Rønne Petersen 6ed30064d3 std.debug.cpu_context: add mcontext_t for riscv32-netbsd and riscv64-netbsd 2026-05-26 15:40:42 +02:00
Alex Rønne Petersen 79e87e5753 std.debug: add m88k-openbsd support
closes https://codeberg.org/ziglang/zig/issues/31817
2026-05-23 11:02:56 +02:00
Alex Rønne Petersen a439978f05 std.debug.cpu_context: fix alpha-openbsd ucontext_t
These fields need to be wrapped in an mcontext field so the common code in
fromPosixSignalContext() can work with it.
2026-05-23 11:02:38 +02:00
Mai-Lapyst 7534ac7367 Adding more support for DEC Alpha to std
This adds support to std, primarily for linux, to support the Alpha architecture.

closes #30940
closes #30926
2026-05-23 06:15:24 +02:00
Alex Rønne Petersen 3b3833acf7 remove remnants of {m68k,powerpc,sparc64}-haiku support
These ports of Haiku have been nonfunctional/incomplete for years. We do not
generally treat such ports as "real" targets.

https://codeberg.org/ziglang/ziglang.org/commit/1efffd83ffd4078cea456c80ae806259207530ad
2026-05-21 06:38:51 +02:00
Matthew Lugg fdac89d6cd remove uses of array multiplication
In preparation for its removal as accepted in
https://github.com/ziglang/zig/issues/24738.
2026-04-30 08:57:51 +01:00
andrew.kraevskii bbab366b78 Audit usages of toOwnedSlice (#32001)
Followup to #30769

I grepped for `try .*toOwnedSlice` and checked all of them by hand.

Fixes a bunch of memory leaks removes usages or `errdefer` and `vars` in some places. I also switched array_list.Managed to ArrayList where it was convenient.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32001
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-22 19:35:46 +02:00
Ryan Liptak 3252a05531 Prefer <err> => |e| return e over <err> => return <err>
Avoids the potential for a typo on the `return <err>` side of the prong
2026-04-20 18:03:14 -07:00
Mason Remaley 6707a5efee Arena allocates text 2026-04-13 01:30:14 -07:00
Mason Remaley 4ad665d3c8 Writes symbols to array list argument 2026-04-12 23:50:24 -07:00
Mason Remaley e968e6d004 Fixes typos/out of date comments, switches to unstable sort 2026-04-12 14:09:22 -07:00
Mason Remaley df2413cf69 Removes dead code, updates some tests, fixes typos in comments, formats 2026-04-12 04:01:30 -07:00
Mason Remaley 312ef9558b Mitigation for bug that results in reuse of inlinee IDs when functions share names 2026-04-12 04:01:30 -07:00
Mason Remaley cbd7f54f06 Use readers to simplify PDB parsing 2026-04-12 04:01:30 -07:00
Mason Remaley 334f40576e Cleans up some PDB parsing logic 2026-04-12 04:01:30 -07:00
Mason Remaley 4efbb27aa2 Don't bother resolving symbol names that won't be used
Also fixes some memory management issues
2026-04-12 04:01:30 -07:00
Mason Remaley f6a3a0ca72 Replaces the inline symbol iterator with an array of symbols
The intention behind the iterator was to avoid needing to allocate the
symbols, but in practice we need to allocate them anyway since we need
to reverse their order and don't have random access. The alternative
would be an N^2 algorithm.

In practice this isn't that bad, because even if the allocation fails,
we'll still end up printing the address, so the user still ends up with
the necessary information to reconstruct the crash. I don't think it's
worth it to try to set up some kind of ring buffer or return partial
results on failure, but may revisit this.
2026-04-12 04:01:30 -07:00
Mason Remaley 5a4b5c8b94 Uses dwarf iterator if dwarf symbols found for windows executable 2026-04-12 04:01:30 -07:00
Mason Remaley dcdb562c15 Adds support for running the trace tests through darling, fixes compilation errors in MachO due to interface change 2026-04-12 04:01:30 -07:00
Mason Remaley 492efd4c06 Adds support for running stack and error trace tests through Wine
Also fixes minor bug that was preventing existing tests from passing on
32 bit Windows
2026-04-12 04:01:30 -07:00
Mason Remaley cc15c8ae7e Cleans up binary annotation opcodes that we don't handle 2026-04-12 04:01:29 -07:00
Mason Remaley fa26ab6fa3 Cleans up handling of signed line deltas 2026-04-12 04:01:29 -07:00
Mason Remaley 7ec2f2b27d Cleans up, implements handling for the change file binary annotation 2026-04-12 04:01:29 -07:00
Mason Remaley a1a8dd1b40 Filters out duplicate sites, outputs compile unit name 2026-04-12 04:01:29 -07:00
Mason Remaley 781bab193b Iterates inline sites in the correct order 2026-04-12 04:01:29 -07:00
Mason Remaley 5c6885be53 Fixes bug that would stop iterating inline site syms early
This fix reveals another bug--we need to display the inline site syms in
the reverse of the encoded order. The parent/child relationships are
actually encoded on the inline sites, but it's likely a bit fragile to
try to trace those, and also more complex. As long as there aren't
multiple matches this is fine, and if there are, tracing the parent/child
chain won't work anyway.
2026-04-12 04:01:29 -07:00
Mason Remaley 22f9592dc7 First pass at reading inline info from PDBs 2026-04-12 04:01:29 -07:00
Corentin Kerisit 07f05426fc Support ld64.ldd STABS layout in MachOFile.load
Apple's ld emit N_BNSYM and N_ENSYM to mark the start and end of
functions, while ld64.lld doesn't.

This resulted in MachOFile.load bailing out on unsupported STABS
layout when the linker used is ld64.lld.

This commit supports both layouts.
2026-04-12 01:23:17 +02:00
Andrew Kelley e9df86aed0 Merge pull request 'std.heap.ArenaAllocator: decrease fuzz test workload per run' (#31596) from justusk/zig:fuzz-arena-2 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31596
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-02 15:57:41 +02:00
Jonathan Marler f4eecf8d7d handle EROFS in create/open file
I hit an unexpected errno 30 on macos attempting to call createFile on a
directory in PATH.  errno 30 is EROFS, this change propagates that error
as error.ReadOnlyFileSystem.
2026-04-02 15:05:31 +02:00
Justus Klausecker 79f8cf1326 std.debug.Info: make Mach-O source location resolution more resilient
`resolveAddresses` now also works if some calls to `getDwarfForAddress`
fail with `error.MissingDebugInfo`; the affected source location is set
to `.invalid`.

This makes fuzzing work with `ReleaseSafe` for Mach-O.
2026-03-20 17:19:28 +01:00
Alex Rønne Petersen 30de1678a6 Merge pull request 'basic loongarch32-linux support' (#31587) from alexrp/zig:loongarch32 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31587
2026-03-20 02:04:25 +01:00
Alex Rønne Petersen eeb62ef346 std.debug.cpu_context: add loongarch32-linux support 2026-03-19 19:53:03 +01:00
Jacob Young 9ac1386c10 std.Io.Threaded: windows networking without ws2_32 2026-03-18 20:13:59 -04:00
Matthew Lugg 8eefe86939 std: remove default values from ArrayList
These were deprecated in the 0.14.0 release cycle almost a year ago, so
they can definitely be deleted now.
2026-03-10 10:26:08 +00:00
Andrew Kelley ba293eb820 Revert "compiler: override debug_io in release + evented mode"
This reverts commit 6840326711.

The commit bungled deinitialization in main.
2026-02-11 10:44:04 -08:00
Andrew Kelley 6840326711 compiler: override debug_io in release + evented mode
to avoid a dependency on std.Io.Threaded in such case
2026-02-11 00:27:06 +01:00
Jacob Young b5bd494606 std.Threaded: replace more kernel32 functions with ntdll 2026-02-07 00:02:50 -05:00
Andrew Kelley 4c4e9d054e std.Io: add RwLock and Semaphore sync primitives
and restore usage by std.debug.SelfInfo.Elf
2026-02-02 20:18:14 -08:00
Andrew Kelley 550da1b676 std: migrate remaining sync primitives to Io
- delete std.Thread.Futex
- delete std.Thread.Mutex
- delete std.Thread.Semaphore
- delete std.Thread.Condition
- delete std.Thread.RwLock
- delete std.once

std.Thread.Mutex.Recursive remains... for now. it will be replaced with
a special purpose mechanism used only by panic logic.

std.Io.Threaded exposes mutexLock and mutexUnlock for the advanced case
when you need to call them directly.
2026-02-02 18:57:17 -08:00
Andrew Kelley 18c6abc0ba std: finish moving os.windows.ReadLink logic to Io.Threaded
- remove error.SharingViolation from all error sets since it has the
  same meaning as FileBusy
- add error.FileBusy to CreateFileAtomicError and ReadLinkError
- update dirReadLinkWindows to use NtCreateFile and NtFsControlFile and
  integrate with cancelation properly.
- move windows CTL_CODE constants to the proper namespace
- delete os.windows.ReadLink
2026-01-28 17:02:17 -08:00