| ... | @@ -411,7 +411,8 @@ pub const StackIterator = struct { | ... | @@ -411,7 +411,8 @@ pub const StackIterator = struct { |
| 411 | // When DebugInfo and a register context is available, this iterator can unwind | 411 | // When DebugInfo and a register context is available, this iterator can unwind |
| 412 | // stacks with frames that don't use a frame pointer (ie. -fomit-frame-pointer). | 412 | // stacks with frames that don't use a frame pointer (ie. -fomit-frame-pointer). |
| 413 | debug_info: ?*DebugInfo, | 413 | debug_info: ?*DebugInfo, |
| 414 | dwarf_context: if (@hasDecl(os, "ucontext_t")) DW.UnwindContext else void = undefined, | 414 | dwarf_context: if (supports_context) DW.UnwindContext else void = undefined, |
| | 415 | const supports_context = @hasDecl(os.system, "ucontext_t"); |
| 415 | | 416 | |
| 416 | pub fn init(first_address: ?usize, fp: ?usize) StackIterator { | 417 | pub fn init(first_address: ?usize, fp: ?usize) StackIterator { |
| 417 | if (native_arch == .sparc64) { | 418 | if (native_arch == .sparc64) { |
| ... | @@ -526,7 +527,7 @@ pub const StackIterator = struct { | ... | @@ -526,7 +527,7 @@ pub const StackIterator = struct { |
| 526 | } | 527 | } |
| 527 | | 528 | |
| 528 | fn next_internal(self: *StackIterator) ?usize { | 529 | fn next_internal(self: *StackIterator) ?usize { |
| 529 | if (self.debug_info != null) { | 530 | if (supports_context and self.debug_info != null) { |
| 530 | if (self.next_dwarf()) |_| { | 531 | if (self.next_dwarf()) |_| { |
| 531 | return self.dwarf_context.pc; | 532 | return self.dwarf_context.pc; |
| 532 | } else |err| { | 533 | } else |err| { |