| ... | ... | @@ -452,26 +452,37 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext, os: std.Target. |
| 452 | 452 | }, |
| 453 | 453 | }); |
| 454 | 454 | |
| 455 | | // TODO: the standard library has a bug in PDB parsing where given an address corresponding |
| 456 | | // to an inline call, the frame we see will be for the *caller*, not the *callee*. As a |
| 457 | | // result this test gives bogus results on Windows right now. |
| 458 | | // This is a part of https://codeberg.org/ziglang/zig/issues/30847. |
| 459 | | if (os != .windows) { |
| 460 | | cases.addCase(.{ |
| 461 | | .name = "trace through inline call", |
| 462 | | .source = |
| 463 | | \\pub fn main() !void { |
| 464 | | \\ try foo(); |
| 465 | | \\} |
| 466 | | \\inline fn foo() !void { |
| 467 | | \\ try bar(); |
| 468 | | \\} |
| 469 | | \\fn bar() !void { |
| 455 | cases.addCase(.{ |
| 456 | .name = "trace through inline call", |
| 457 | .source = |
| 458 | \\pub fn main() !void { |
| 459 | \\ try foo(); |
| 460 | \\} |
| 461 | \\inline fn foo() !void { |
| 462 | \\ try bar(); |
| 463 | \\} |
| 464 | \\fn bar() !void { |
| 465 | \\ return error.ThisIsSoSad; |
| 466 | \\} |
| 467 | , |
| 468 | .expect_error = "ThisIsSoSad", |
| 469 | .expect_trace = |
| 470 | switch (os) { |
| 471 | // LLVM doesn't emit column info in the binary annotations for inlinee callees in PDBs, |
| 472 | // so our expected result is slightly different for Windows than on other operating |
| 473 | // systems. |
| 474 | .windows => |
| 475 | \\source.zig:8:5: [address] in bar |
| 470 | 476 | \\ return error.ThisIsSoSad; |
| 471 | | \\} |
| 477 | \\ ^ |
| 478 | \\source.zig:5: [address] in foo |
| 479 | \\ try bar(); |
| 480 | \\ |
| 481 | \\source.zig:2:5: [address] in main |
| 482 | \\ try foo(); |
| 483 | \\ ^ |
| 472 | 484 | , |
| 473 | | .expect_error = "ThisIsSoSad", |
| 474 | | .expect_trace = |
| 485 | else => |
| 475 | 486 | \\source.zig:8:5: [address] in bar |
| 476 | 487 | \\ return error.ThisIsSoSad; |
| 477 | 488 | \\ ^ |
| ... | ... | @@ -482,24 +493,24 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext, os: std.Target. |
| 482 | 493 | \\ try foo(); |
| 483 | 494 | \\ ^ |
| 484 | 495 | , |
| 485 | | .disable_trace_optimized = &.{ |
| 486 | | .{ .x86_64, .freebsd }, |
| 487 | | .{ .x86_64, .netbsd }, |
| 488 | | .{ .x86_64, .linux }, |
| 489 | | .{ .x86, .linux }, |
| 490 | | .{ .aarch64, .freebsd }, |
| 491 | | .{ .aarch64, .netbsd }, |
| 492 | | .{ .aarch64, .linux }, |
| 493 | | .{ .loongarch64, .linux }, |
| 494 | | .{ .powerpc64le, .linux }, |
| 495 | | .{ .riscv64, .linux }, |
| 496 | | .{ .s390x, .linux }, |
| 497 | | .{ .x86_64, .openbsd }, |
| 498 | | .{ .x86_64, .windows }, |
| 499 | | .{ .x86, .windows }, |
| 500 | | .{ .x86_64, .macos }, |
| 501 | | .{ .aarch64, .macos }, |
| 502 | | }, |
| 503 | | }); |
| 504 | | } |
| 496 | }, |
| 497 | .disable_trace_optimized = &.{ |
| 498 | .{ .x86_64, .freebsd }, |
| 499 | .{ .x86_64, .netbsd }, |
| 500 | .{ .x86_64, .linux }, |
| 501 | .{ .x86, .linux }, |
| 502 | .{ .aarch64, .freebsd }, |
| 503 | .{ .aarch64, .netbsd }, |
| 504 | .{ .aarch64, .linux }, |
| 505 | .{ .loongarch64, .linux }, |
| 506 | .{ .powerpc64le, .linux }, |
| 507 | .{ .riscv64, .linux }, |
| 508 | .{ .s390x, .linux }, |
| 509 | .{ .x86_64, .openbsd }, |
| 510 | .{ .x86_64, .windows }, |
| 511 | .{ .x86, .windows }, |
| 512 | .{ .x86_64, .macos }, |
| 513 | .{ .aarch64, .macos }, |
| 514 | }, |
| 515 | }); |
| 505 | 516 | } |