aboutsummaryrefslogtreecommitdiff
path: root/std/debug/index.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-03-08 10:59:54 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-03-08 10:59:54 -0500
commit3200ebc2ea5f6bb51130cbc69d6533144a9f4ddc (patch)
treee234c061c28a95c35afbb35b80b89e3114ecdeb9 /std/debug/index.zig
parent2e010c60ae006944ae20ab8b3445598471c9f1e8 (diff)
parentb57cb04afc1898c3b21ef3486709f0c0aa285433 (diff)
downloadzig-3200ebc2ea5f6bb51130cbc69d6533144a9f4ddc.tar.gz
zig-3200ebc2ea5f6bb51130cbc69d6533144a9f4ddc.zip
Merge branch 'llvm6'
Zig now depends on LLVM 6.0.0. The latest commit that depends on LLVM 5.0.1 is 2e010c60ae006944ae20ab8b3445598471c9f1e8.
Diffstat (limited to 'std/debug/index.zig')
-rw-r--r--std/debug/index.zig11
1 files changed, 9 insertions, 2 deletions
diff --git a/std/debug/index.zig b/std/debug/index.zig
index 8d90a6aa07..b26800677f 100644
--- a/std/debug/index.zig
+++ b/std/debug/index.zig
@@ -791,14 +791,21 @@ fn getLineNumberInfo(st: &ElfStackTrace, compile_unit: &const CompileUnit, targe
}
const version = try in_stream.readInt(st.elf.endian, u16);
- if (version != 2) return error.InvalidDebugInfo;
+ // TODO support 3 and 5
+ if (version != 2 and version != 4) return error.InvalidDebugInfo;
- const prologue_length = try in_stream.readInt(st.elf.endian, u32);
+ const prologue_length = if (is_64) try in_stream.readInt(st.elf.endian, u64)
+ else try in_stream.readInt(st.elf.endian, u32);
const prog_start_offset = (try in_file.getPos()) + prologue_length;
const minimum_instruction_length = try in_stream.readByte();
if (minimum_instruction_length == 0) return error.InvalidDebugInfo;
+ if (version >= 4) {
+ // maximum_operations_per_instruction
+ _ = try in_stream.readByte();
+ }
+
const default_is_stmt = (try in_stream.readByte()) != 0;
const line_base = try in_stream.readByteSigned();