From c895aa7a35b178576b89e600a20af9d16da36dea Mon Sep 17 00:00:00 2001 From: mlugg Date: Wed, 3 Sep 2025 15:42:33 +0100 Subject: std.debug.SelfInfo: concrete error sets The downside of this commit is that more precise errors are no longer propagated up. However, these errors were pretty useless in isolation due to them having no context; and regardless, we intentionally swallow most of them in `std.debug` anyway. Therefore, this is better in practice, because it allows `std.debug` to give slightly more useful warnings when handling errors. This commit does that for unwind errors, for instance, which differentiate between the unwind info being corrupt vs missing vs inaccessible vs unsupported. A better solution would be to also include more detailed information via the diagnostics pattern, but this commit is an incremental improvement. --- lib/std/debug/Dwarf.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/debug/Dwarf.zig') diff --git a/lib/std/debug/Dwarf.zig b/lib/std/debug/Dwarf.zig index 0ba4ab8048..f50b9ed163 100644 --- a/lib/std/debug/Dwarf.zig +++ b/lib/std/debug/Dwarf.zig @@ -1418,7 +1418,7 @@ pub fn compactUnwindToDwarfRegNumber(unwind_reg_number: u3) !u8 { 4 => 14, // R14 5 => 15, // R15 6 => 6, // RBP - else => error.InvalidUnwindRegisterNumber, + else => error.InvalidRegister, }; } -- cgit v1.2.3