| ... | @@ -623,7 +623,7 @@ pub const StackUnwindOptions = struct { | ... | @@ -623,7 +623,7 @@ pub const StackUnwindOptions = struct { |
| 623 | /// the given buffer, so `addr_buf` must have a lifetime at least equal to the `StackTrace`. | 623 | /// the given buffer, so `addr_buf` must have a lifetime at least equal to the `StackTrace`. |
| 624 | /// | 624 | /// |
| 625 | /// See `writeCurrentStackTrace` to immediately print the trace instead of capturing it. | 625 | /// See `writeCurrentStackTrace` to immediately print the trace instead of capturing it. |
| 626 | pub fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf: []usize) std.builtin.StackTrace { | 626 | pub noinline fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf: []usize) std.builtin.StackTrace { |
| 627 | const empty_trace: std.builtin.StackTrace = .{ .index = 0, .instruction_addresses = &.{} }; | 627 | const empty_trace: std.builtin.StackTrace = .{ .index = 0, .instruction_addresses = &.{} }; |
| 628 | if (!std.options.allow_stack_tracing) return empty_trace; | 628 | if (!std.options.allow_stack_tracing) return empty_trace; |
| 629 | var it = StackIterator.init(options.context) catch return empty_trace; | 629 | var it = StackIterator.init(options.context) catch return empty_trace; |
| ... | @@ -661,7 +661,7 @@ pub fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf: []usize) | ... | @@ -661,7 +661,7 @@ pub fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf: []usize) |
| 661 | /// Write the current stack trace to `writer`, annotated with source locations. | 661 | /// Write the current stack trace to `writer`, annotated with source locations. |
| 662 | /// | 662 | /// |
| 663 | /// See `captureCurrentStackTrace` to capture the trace addresses into a buffer instead of printing. | 663 | /// See `captureCurrentStackTrace` to capture the trace addresses into a buffer instead of printing. |
| 664 | pub fn writeCurrentStackTrace(options: StackUnwindOptions, writer: *Writer, tty_config: tty.Config) Writer.Error!void { | 664 | pub noinline fn writeCurrentStackTrace(options: StackUnwindOptions, writer: *Writer, tty_config: tty.Config) Writer.Error!void { |
| 665 | if (!std.options.allow_stack_tracing) { | 665 | if (!std.options.allow_stack_tracing) { |
| 666 | tty_config.setColor(writer, .dim) catch {}; | 666 | tty_config.setColor(writer, .dim) catch {}; |
| 667 | try writer.print("Cannot print stack trace: stack tracing is disabled\n", .{}); | 667 | try writer.print("Cannot print stack trace: stack tracing is disabled\n", .{}); |