| ... | @@ -791,14 +791,21 @@ fn getLineNumberInfo(st: &ElfStackTrace, compile_unit: &const CompileUnit, targe | ... | @@ -791,14 +791,21 @@ fn getLineNumberInfo(st: &ElfStackTrace, compile_unit: &const CompileUnit, targe |
| 791 | } | 791 | } |
| 792 | | 792 | |
| 793 | const version = try in_stream.readInt(st.elf.endian, u16); | 793 | const version = try in_stream.readInt(st.elf.endian, u16); |
| 794 | if (version != 2) return error.InvalidDebugInfo; | 794 | // TODO support 3 and 5 |
| | 795 | if (version != 2 and version != 4) return error.InvalidDebugInfo; |
| 795 | | 796 | |
| 796 | const prologue_length = try in_stream.readInt(st.elf.endian, u32); | 797 | const prologue_length = if (is_64) try in_stream.readInt(st.elf.endian, u64) |
| | 798 | else try in_stream.readInt(st.elf.endian, u32); |
| 797 | const prog_start_offset = (try in_file.getPos()) + prologue_length; | 799 | const prog_start_offset = (try in_file.getPos()) + prologue_length; |
| 798 | | 800 | |
| 799 | const minimum_instruction_length = try in_stream.readByte(); | 801 | const minimum_instruction_length = try in_stream.readByte(); |
| 800 | if (minimum_instruction_length == 0) return error.InvalidDebugInfo; | 802 | if (minimum_instruction_length == 0) return error.InvalidDebugInfo; |
| 801 | | 803 | |
| | 804 | if (version >= 4) { |
| | 805 | // maximum_operations_per_instruction |
| | 806 | _ = try in_stream.readByte(); |
| | 807 | } |
| | 808 | |
| 802 | const default_is_stmt = (try in_stream.readByte()) != 0; | 809 | const default_is_stmt = (try in_stream.readByte()) != 0; |
| 803 | const line_base = try in_stream.readByteSigned(); | 810 | const line_base = try in_stream.readByteSigned(); |
| 804 | | 811 | |