| ... | @@ -129,7 +129,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void { | ... | @@ -129,7 +129,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void { |
| 129 | return; | 129 | return; |
| 130 | }; | 130 | }; |
| 131 | const tty_config = detectTTYConfig(); | 131 | const tty_config = detectTTYConfig(); |
| 132 | printSourceAtAddress(debug_info, stderr, ip, tty_config) catch return; | 132 | printSourceAtAddress(debug_info, stderr, if (builtin.os == .windows) (ip + 1) else ip, tty_config) catch return; |
| 133 | const first_return_address = @intToPtr(*const usize, bp + @sizeOf(usize)).*; | 133 | const first_return_address = @intToPtr(*const usize, bp + @sizeOf(usize)).*; |
| 134 | printSourceAtAddress(debug_info, stderr, first_return_address - 1, tty_config) catch return; | 134 | printSourceAtAddress(debug_info, stderr, first_return_address - 1, tty_config) catch return; |
| 135 | var it = StackIterator{ | 135 | var it = StackIterator{ |
| ... | @@ -325,6 +325,7 @@ pub const StackIterator = struct { | ... | @@ -325,6 +325,7 @@ pub const StackIterator = struct { |
| 325 | } | 325 | } |
| 326 | | 326 | |
| 327 | const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*; | 327 | const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*; |
| | 328 | if (return_address == 0) return null; |
| 328 | return return_address; | 329 | return return_address; |
| 329 | } | 330 | } |
| 330 | }; | 331 | }; |