| ... | @@ -221,7 +221,7 @@ pub fn writeStackTrace( | ... | @@ -221,7 +221,7 @@ pub fn writeStackTrace( |
| 221 | frame_index = (frame_index + 1) % stack_trace.instruction_addresses.len; | 221 | frame_index = (frame_index + 1) % stack_trace.instruction_addresses.len; |
| 222 | }) { | 222 | }) { |
| 223 | const return_address = stack_trace.instruction_addresses[frame_index]; | 223 | const return_address = stack_trace.instruction_addresses[frame_index]; |
| 224 | try printSourceAtAddress(debug_info, out_stream, return_address, tty_color); | 224 | try printSourceAtAddress(debug_info, out_stream, return_address - 1, tty_color); |
| 225 | } | 225 | } |
| 226 | } | 226 | } |
| 227 | | 227 | |
| ... | @@ -263,7 +263,7 @@ pub fn writeCurrentStackTrace(out_stream: var, debug_info: *DebugInfo, tty_color | ... | @@ -263,7 +263,7 @@ pub fn writeCurrentStackTrace(out_stream: var, debug_info: *DebugInfo, tty_color |
| 263 | } | 263 | } |
| 264 | var it = StackIterator.init(start_addr); | 264 | var it = StackIterator.init(start_addr); |
| 265 | while (it.next()) |return_address| { | 265 | while (it.next()) |return_address| { |
| 266 | try printSourceAtAddress(debug_info, out_stream, return_address, tty_color); | 266 | try printSourceAtAddress(debug_info, out_stream, return_address - 1, tty_color); |
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 269 | | 269 | |
| ... | @@ -689,9 +689,9 @@ pub fn printSourceAtAddressDwarf( | ... | @@ -689,9 +689,9 @@ pub fn printSourceAtAddressDwarf( |
| 689 | return; | 689 | return; |
| 690 | }; | 690 | }; |
| 691 | const compile_unit_name = try compile_unit.die.getAttrString(debug_info, DW.AT_name); | 691 | const compile_unit_name = try compile_unit.die.getAttrString(debug_info, DW.AT_name); |
| 692 | if (getLineNumberInfoDwarf(debug_info, compile_unit.*, address - 1)) |line_info| { | 692 | if (getLineNumberInfoDwarf(debug_info, compile_unit.*, address)) |line_info| { |
| 693 | defer line_info.deinit(); | 693 | defer line_info.deinit(); |
| 694 | const symbol_name = getSymbolNameDwarf(debug_info, address - 1) orelse "???"; | 694 | const symbol_name = getSymbolNameDwarf(debug_info, address) orelse "???"; |
| 695 | try printLineInfo( | 695 | try printLineInfo( |
| 696 | out_stream, | 696 | out_stream, |
| 697 | line_info, | 697 | line_info, |