Commit Graph

13340 Commits

Author SHA1 Message Date
Elaine Gibson c94ea1ea2d std.Io.Threaded: haiku fixes 2026-04-14 12:04:41 +01:00
Elaine Gibson f0666586f6 std.c: add haiku readv_pos and write_pov 2026-04-14 12:04:41 +01:00
Elaine Gibson 90399b83e7 std.zig.LibCInstallation: fix findNativeGccDirHaiku 2026-04-14 12:04:41 +01:00
krystiann 8578b07faa std.os.linux: add arc arch bits 2026-04-14 12:51:44 +02:00
David Gonzalez Martin 37a20d3984 Allow the user to override unexpected error trace
This is the only bit left in the standard library where stack trace writing
code is pulled to the binary even if the user doesn't want it
2026-04-13 19:58:01 +02: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 541bd6c369 Updates more failing tests 2026-04-12 04:01:30 -07:00
Mason Remaley 87fb7df257 Updates stack trace vs error return trace in more places 2026-04-12 04:01:30 -07:00
Mason Remaley ac207073f3 Reverts renaming of builtin.StackTrace -> ErrorReturnTrace
We can defer this change until the next time zig1 needs to be updated
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 c2cbb944ba Further improvements to stack trace type 2026-04-12 04:01:29 -07:00
Mason Remaley 6bf583c4ba Further separation of stack trace and error return trace 2026-04-12 04:01:29 -07:00
Mason Remaley 94ff38af87 Separates error return traces from stack traces
Doesn't commit the changes to stage1, we can generate those at the end
once we're not making any more changes to it to avoid wasting storage.
2026-04-12 04:01:29 -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 094e841f09 Don't print column if column info is missing 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 156f54d8f0 Adds includes_inlined_frames option to builtin.StackTrace
This will be relevant once #31605 is merged.

In general, stack traces do *not* contain unique addresses for inlined
frames, but for error return traces, they will after the above PR. This
bool indicates that code printing the trace should not try to resolve
inline frames since they're explicitly encoded into the instruction
addresses.

This is set as state on stack trace rather than passed into the
formatting methods as an argument, as it's not really a formatting
option--whether or not it's correct to resolve inlines is decided at the
time of capture!
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
Andrew Kelley 8da2f93bd0 Merge pull request 'update aro and translate-c to latest' (#31826) from aro-sync into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31826
2026-04-12 07:28:18 +02:00
Andrew Kelley 2322d45d80 Merge pull request 'Implement variadic functions for Win64 in the x86_64 backend' (#31672) from kcbanner/zig:win64_varargs into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31672
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-12 01:34:16 +02: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 5149128d22 update translate-c to latest
upstream commit 46b5609b5ac4c0a896217d1d984f3ae50e4810b5
2026-04-11 15:17:46 -07:00
Frank Denis bc08199ef1 crypto TLS bundle: make AddCertsFromDirPathError compile
It's calling `addCertsFromDir`, which now requires a timestamp,
so it didn't compile any more.

Add a test by the way.
2026-04-12 00:13:59 +02:00
Carl Åstholm 81be7f62ec Fix debug I/O color detection for most targets
On POSIX, start.zig did not reset the `environ_initialized` field, which
prevented the environment variables from ever actually getting scanned.

On Windows, environment variable scanning is allocation-free, so it's
okay for `std.Io.Threaded.init_single_threaded` to use the global
environment block.
2026-04-11 12:28:24 -07:00
Carl Åstholm 3223d3a1ac Improve debug I/O color detection/handling for WASI and Emscripten
When linking libc, these targets can get their environment variables
from `std.c.environ`. Additionally, it's okay for WASI to use ANSI
escape sequences; nothing in the relevant specs claim otherwise.
2026-04-11 12:25:22 -07:00
Carl Åstholm 3d48264365 Fix -fwasmtime not inheriting environment variables 2026-04-11 12:23:49 -07:00
Luna Schwalbe 0bbf0461d9 std.http: reliably update reader state
Content length based reading would only set the reader state to `ready`
once it returned EOF, but wrapping readers (such as decompressors)
may stop reading from the underlying source without receiving EOF.
In such cases the http reader state would stay set to
`body_remaining_content_length`, even though the entire body had been
read.

Fixes #30060

Co-authored-by: Andrew Kelley <andre@ziglang.org>
2026-04-11 11:04:24 -07:00
Andrew Kelley 29225ae11b Merge pull request 'x64_86 fix: RMI can accept imm16 only for imul r16,r/m16' (#31234) from mathk/zig:x64_86-misscompfix-rmi16 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31234
Reviewed-by: jacobly <jacobly@noreply.codeberg.org>
2026-04-11 18:08:07 +02:00
Andrew Kelley cbe468a787 Merge pull request 'Sema: allow @round, @floor, @ceil, and @trunc to coerce to integer types' (#30906) from adria/zig:sema-rounding-casts into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30906
2026-04-11 16:44:41 +02:00
Alex Rønne Petersen d2e42fe9de std.Target: default ABI to eabihf for psp 2026-04-11 12:55:45 +02:00
Alex Rønne Petersen 71e5ee9a51 std.Target: allegrex mips CPU can only be little endian 2026-04-11 12:48:58 +02:00
Alex Rønne Petersen fa9caeba1b std.Io.net.test: disable listen on a port, send bytes, receive bytes
Still happens: https://codeberg.org/ziglang/zig/issues/31388#issuecomment-12968295
2026-04-11 06:50:53 +02:00
Alex Rønne Petersen d6f43caadf Merge pull request 'audit: handle process.Child.Term exhaustively and give useful exit information on process exit' (#31018) from murtaza/zig:child.term-audit into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31018
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-04-11 00:59:11 +02:00
Jacob Young 1552bc7ad0 x86_64: fix mir rmi signedness 2026-04-10 23:23:33 +02:00
Andrew Kelley c3a862522b std: remove managed array hash map variants
And deprecate all the API names except for:
* `std.array_hash_map.Auto`
* `std.array_hash_map.String`
* `std.array_hash_map.Custom`
2026-04-10 17:39:45 +02:00
Andrew Kelley 0606af509f translate-c build step: remove use_clang field
This no longer does anything.
2026-04-09 14:05:45 -07:00