| ... | ... | @@ -168,6 +168,11 @@ const CompileUnit = struct { |
| 168 | 168 | is_64: bool, |
| 169 | 169 | die: *Die, |
| 170 | 170 | pc_range: ?PcRange, |
| 171 | |
| 172 | str_offsets_base: usize, |
| 173 | addr_base: usize, |
| 174 | rnglists_base: usize, |
| 175 | loclists_base: usize, |
| 171 | 176 | }; |
| 172 | 177 | |
| 173 | 178 | const AbbrevTable = std.ArrayList(AbbrevTableEntry); |
| ... | ... | @@ -205,7 +210,7 @@ const AbbrevAttr = struct { |
| 205 | 210 | |
| 206 | 211 | const FormValue = union(enum) { |
| 207 | 212 | Address: u64, |
| 208 | | AddrOffset: u64, |
| 213 | AddrOffset: usize, |
| 209 | 214 | Block: []u8, |
| 210 | 215 | Const: Constant, |
| 211 | 216 | ExprLoc: []u8, |
| ... | ... | @@ -215,10 +220,11 @@ const FormValue = union(enum) { |
| 215 | 220 | RefAddr: u64, |
| 216 | 221 | String: []const u8, |
| 217 | 222 | StrPtr: u64, |
| 218 | | StrOffset: u64, |
| 223 | StrOffset: usize, |
| 219 | 224 | LineStrPtr: u64, |
| 220 | 225 | LocListOffset: u64, |
| 221 | 226 | RangeListOffset: u64, |
| 227 | data16: [16]u8, |
| 222 | 228 | |
| 223 | 229 | fn getString(fv: FormValue, di: DwarfInfo) ![]const u8 { |
| 224 | 230 | switch (fv) { |
| ... | ... | @@ -235,6 +241,14 @@ const FormValue = union(enum) { |
| 235 | 241 | const int = try c.asUnsignedLe(); |
| 236 | 242 | return math.cast(U, int) orelse return badDwarf(); |
| 237 | 243 | }, |
| 244 | .SecOffset => |x| return math.cast(U, x) orelse return badDwarf(), |
| 245 | else => return badDwarf(), |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | fn getData16(fv: FormValue) ![16]u8 { |
| 250 | switch (fv) { |
| 251 | .data16 => |d| return d, |
| 238 | 252 | else => return badDwarf(), |
| 239 | 253 | } |
| 240 | 254 | } |
| ... | ... | @@ -274,42 +288,30 @@ const Die = struct { |
| 274 | 288 | return null; |
| 275 | 289 | } |
| 276 | 290 | |
| 277 | | fn getAttrAddr(self: *const Die, di: *DwarfInfo, id: u64) error{ InvalidDebugInfo, MissingDebugInfo }!u64 { |
| 278 | | const form_value = self.getAttr(id) orelse return missingDwarf(); |
| 291 | fn getAttrAddr( |
| 292 | self: *const Die, |
| 293 | di: *DwarfInfo, |
| 294 | id: u64, |
| 295 | compile_unit: CompileUnit, |
| 296 | ) error{ InvalidDebugInfo, MissingDebugInfo }!u64 { |
| 297 | const form_value = self.getAttr(id) orelse return error.MissingDebugInfo; |
| 279 | 298 | return switch (form_value.*) { |
| 280 | 299 | FormValue.Address => |value| value, |
| 281 | 300 | FormValue.AddrOffset => |index| { |
| 282 | 301 | const debug_addr = di.debug_addr orelse return badDwarf(); |
| 283 | | if (debug_addr.len < 8) return badDwarf(); |
| 284 | | const first_32_bits = mem.readInt(u32, debug_addr[0..4], di.endian); |
| 285 | | const is_64 = first_32_bits == 0xffffffff; |
| 286 | | var off: usize = undefined; |
| 287 | | const length: u64 = l: { |
| 288 | | if (is_64) { |
| 289 | | if (debug_addr.len < 16) return badDwarf(); |
| 290 | | off = 12; |
| 291 | | break :l mem.readInt(u64, debug_addr[4..12], di.endian); |
| 292 | | } else { |
| 293 | | if (debug_addr.len < 8) return badDwarf(); |
| 294 | | if (first_32_bits >= 0xfffffff0) return badDwarf(); |
| 295 | | off = 4; |
| 296 | | break :l first_32_bits; |
| 297 | | } |
| 298 | | }; |
| 299 | | if (index > length) return badDwarf(); |
| 300 | | |
| 301 | | const version = mem.readInt(u16, debug_addr[off..][0..2], di.endian); |
| 302 | | off += 2; |
| 303 | | if (version < 5) return badDwarf(); |
| 302 | // addr_base points to the first item after the header, however we |
| 303 | // need to read the header to know the size of each item. Empirically, |
| 304 | // it may disagree with is_64 on the compile unit. |
| 305 | // The header is 8 or 12 bytes depending on is_64. |
| 306 | if (compile_unit.addr_base < 8) return badDwarf(); |
| 304 | 307 | |
| 305 | | const addr_size = debug_addr[off]; |
| 306 | | off += 1; |
| 308 | const version = mem.readInt(u16, debug_addr[compile_unit.addr_base - 4 ..][0..2], di.endian); |
| 309 | if (version != 5) return badDwarf(); |
| 307 | 310 | |
| 308 | | const seg_size = debug_addr[off]; |
| 309 | | off += 1; |
| 311 | const addr_size = debug_addr[compile_unit.addr_base - 2]; |
| 312 | const seg_size = debug_addr[compile_unit.addr_base - 1]; |
| 310 | 313 | |
| 311 | | const base_offset = self.getAttrSecOffset(AT.addr_base) catch off; |
| 312 | | const byte_offset = base_offset + (addr_size + seg_size) * index; |
| 314 | const byte_offset = compile_unit.addr_base + (addr_size + seg_size) * index; |
| 313 | 315 | if (byte_offset + addr_size > debug_addr.len) return badDwarf(); |
| 314 | 316 | switch (addr_size) { |
| 315 | 317 | 1 => return debug_addr[byte_offset], |
| ... | ... | @@ -324,16 +326,12 @@ const Die = struct { |
| 324 | 326 | } |
| 325 | 327 | |
| 326 | 328 | fn getAttrSecOffset(self: *const Die, id: u64) !u64 { |
| 327 | | const form_value = self.getAttr(id) orelse return missingDwarf(); |
| 328 | | return switch (form_value.*) { |
| 329 | | FormValue.Const => |value| value.asUnsignedLe(), |
| 330 | | FormValue.SecOffset => |value| value, |
| 331 | | else => error.InvalidDebugInfo, |
| 332 | | }; |
| 329 | const form_value = self.getAttr(id) orelse return error.MissingDebugInfo; |
| 330 | return form_value.getUInt(u64); |
| 333 | 331 | } |
| 334 | 332 | |
| 335 | 333 | fn getAttrUnsignedLe(self: *const Die, id: u64) !u64 { |
| 336 | | const form_value = self.getAttr(id) orelse return missingDwarf(); |
| 334 | const form_value = self.getAttr(id) orelse return error.MissingDebugInfo; |
| 337 | 335 | return switch (form_value.*) { |
| 338 | 336 | FormValue.Const => |value| value.asUnsignedLe(), |
| 339 | 337 | else => error.InvalidDebugInfo, |
| ... | ... | @@ -341,51 +339,35 @@ const Die = struct { |
| 341 | 339 | } |
| 342 | 340 | |
| 343 | 341 | fn getAttrRef(self: *const Die, id: u64) !u64 { |
| 344 | | const form_value = self.getAttr(id) orelse return missingDwarf(); |
| 342 | const form_value = self.getAttr(id) orelse return error.MissingDebugInfo; |
| 345 | 343 | return switch (form_value.*) { |
| 346 | 344 | FormValue.Ref => |value| value, |
| 347 | 345 | else => error.InvalidDebugInfo, |
| 348 | 346 | }; |
| 349 | 347 | } |
| 350 | 348 | |
| 351 | | pub fn getAttrString(self: *const Die, di: *DwarfInfo, id: u64, opt_str: ?[]const u8) error{ InvalidDebugInfo, MissingDebugInfo }![]const u8 { |
| 352 | | const form_value = self.getAttr(id) orelse return missingDwarf(); |
| 349 | pub fn getAttrString( |
| 350 | self: *const Die, |
| 351 | di: *DwarfInfo, |
| 352 | id: u64, |
| 353 | opt_str: ?[]const u8, |
| 354 | compile_unit: CompileUnit, |
| 355 | ) error{ InvalidDebugInfo, MissingDebugInfo }![]const u8 { |
| 356 | const form_value = self.getAttr(id) orelse return error.MissingDebugInfo; |
| 353 | 357 | switch (form_value.*) { |
| 354 | 358 | FormValue.String => |value| return value, |
| 355 | 359 | FormValue.StrPtr => |offset| return di.getString(offset), |
| 356 | 360 | FormValue.StrOffset => |index| { |
| 357 | 361 | const debug_str_offsets = di.debug_str_offsets orelse return badDwarf(); |
| 358 | | if (debug_str_offsets.len < 8) return badDwarf(); |
| 359 | | const first_32_bits = mem.readInt(u32, debug_str_offsets[0..4], di.endian); |
| 360 | | const is_64 = first_32_bits == 0xffffffff; |
| 361 | | var off: usize = undefined; |
| 362 | | const length: u64 = l: { |
| 363 | | if (is_64) { |
| 364 | | if (debug_str_offsets.len < 16) return badDwarf(); |
| 365 | | off = 12; |
| 366 | | break :l mem.readInt(u64, debug_str_offsets[4..12], di.endian); |
| 367 | | } else { |
| 368 | | if (debug_str_offsets.len < 8) return badDwarf(); |
| 369 | | if (first_32_bits >= 0xfffffff0) return badDwarf(); |
| 370 | | off = 4; |
| 371 | | break :l first_32_bits; |
| 372 | | } |
| 373 | | }; |
| 374 | | if (index > length) return badDwarf(); |
| 375 | | |
| 376 | | const version = mem.readInt(u16, debug_str_offsets[off..][0..2], di.endian); |
| 377 | | off += 2; |
| 378 | | if (version < 5) return badDwarf(); |
| 379 | | |
| 380 | | off += 2; // reserved |
| 381 | | |
| 382 | | const base_offset = self.getAttrSecOffset(AT.str_offsets_base) catch off; |
| 383 | | if (is_64) { |
| 384 | | const byte_offset = base_offset + 8 * index; |
| 362 | if (compile_unit.str_offsets_base == 0) return badDwarf(); |
| 363 | if (compile_unit.is_64) { |
| 364 | const byte_offset = compile_unit.str_offsets_base + 8 * index; |
| 365 | if (byte_offset + 8 > debug_str_offsets.len) return badDwarf(); |
| 385 | 366 | const offset = mem.readInt(u64, debug_str_offsets[byte_offset..][0..8], di.endian); |
| 386 | 367 | return getStringGeneric(opt_str, offset); |
| 387 | 368 | } else { |
| 388 | | const byte_offset = base_offset + 4 * index; |
| 369 | const byte_offset = compile_unit.str_offsets_base + 4 * index; |
| 370 | if (byte_offset + 4 > debug_str_offsets.len) return badDwarf(); |
| 389 | 371 | const offset = mem.readInt(u32, debug_str_offsets[byte_offset..][0..4], di.endian); |
| 390 | 372 | return getStringGeneric(opt_str, offset); |
| 391 | 373 | } |
| ... | ... | @@ -401,7 +383,7 @@ const FileEntry = struct { |
| 401 | 383 | dir_index: u32 = 0, |
| 402 | 384 | mtime: u64 = 0, |
| 403 | 385 | size: u64 = 0, |
| 404 | | md5: u128 = 0, |
| 386 | md5: [16]u8 = [1]u8{0} ** 16, |
| 405 | 387 | }; |
| 406 | 388 | |
| 407 | 389 | const LineNumberProgram = struct { |
| ... | ... | @@ -606,7 +588,7 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en |
| 606 | 588 | FORM.addrx2 => return FormValue{ .AddrOffset = try in_stream.readInt(u16, endian) }, |
| 607 | 589 | FORM.addrx3 => return FormValue{ .AddrOffset = try in_stream.readInt(u24, endian) }, |
| 608 | 590 | FORM.addrx4 => return FormValue{ .AddrOffset = try in_stream.readInt(u32, endian) }, |
| 609 | | FORM.addrx => return FormValue{ .AddrOffset = try nosuspend leb.readULEB128(u64, in_stream) }, |
| 591 | FORM.addrx => return FormValue{ .AddrOffset = try nosuspend leb.readULEB128(usize, in_stream) }, |
| 610 | 592 | |
| 611 | 593 | FORM.block1 => parseFormValueBlock(allocator, in_stream, endian, 1), |
| 612 | 594 | FORM.block2 => parseFormValueBlock(allocator, in_stream, endian, 2), |
| ... | ... | @@ -619,6 +601,11 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en |
| 619 | 601 | FORM.data2 => parseFormValueConstant(in_stream, false, endian, 2), |
| 620 | 602 | FORM.data4 => parseFormValueConstant(in_stream, false, endian, 4), |
| 621 | 603 | FORM.data8 => parseFormValueConstant(in_stream, false, endian, 8), |
| 604 | FORM.data16 => { |
| 605 | var buf: [16]u8 = undefined; |
| 606 | if ((try nosuspend in_stream.readAll(&buf)) < 16) return error.EndOfFile; |
| 607 | return FormValue{ .data16 = buf }; |
| 608 | }, |
| 622 | 609 | FORM.udata, FORM.sdata => { |
| 623 | 610 | const signed = form_id == FORM.sdata; |
| 624 | 611 | return parseFormValueConstant(in_stream, signed, endian, -1); |
| ... | ... | @@ -647,7 +634,7 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en |
| 647 | 634 | FORM.strx2 => return FormValue{ .StrOffset = try in_stream.readInt(u16, endian) }, |
| 648 | 635 | FORM.strx3 => return FormValue{ .StrOffset = try in_stream.readInt(u24, endian) }, |
| 649 | 636 | FORM.strx4 => return FormValue{ .StrOffset = try in_stream.readInt(u32, endian) }, |
| 650 | | FORM.strx => return FormValue{ .StrOffset = try nosuspend leb.readULEB128(u64, in_stream) }, |
| 637 | FORM.strx => return FormValue{ .StrOffset = try nosuspend leb.readULEB128(usize, in_stream) }, |
| 651 | 638 | FORM.line_strp => FormValue{ .LineStrPtr = try readAddress(in_stream, endian, is_64) }, |
| 652 | 639 | FORM.indirect => { |
| 653 | 640 | const child_form_id = try nosuspend leb.readULEB128(u64, in_stream); |
| ... | ... | @@ -663,7 +650,7 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en |
| 663 | 650 | FORM.loclistx => return FormValue{ .LocListOffset = try nosuspend leb.readULEB128(u64, in_stream) }, |
| 664 | 651 | FORM.rnglistx => return FormValue{ .RangeListOffset = try nosuspend leb.readULEB128(u64, in_stream) }, |
| 665 | 652 | else => { |
| 666 | | std.debug.print("unrecognized form id: {x}\n", .{form_id}); |
| 653 | //std.debug.print("unrecognized form id: {x}\n", .{form_id}); |
| 667 | 654 | return badDwarf(); |
| 668 | 655 | }, |
| 669 | 656 | }; |
| ... | ... | @@ -771,11 +758,26 @@ pub const DwarfInfo = struct { |
| 771 | 758 | |
| 772 | 759 | const next_unit_pos = this_unit_offset + next_offset; |
| 773 | 760 | |
| 761 | var compile_unit: CompileUnit = undefined; |
| 762 | |
| 774 | 763 | while ((try seekable.getPos()) < next_unit_pos) { |
| 775 | | const die_obj = (try di.parseDie(arena, in, abbrev_table, is_64)) orelse continue; |
| 764 | var die_obj = (try di.parseDie(arena, in, abbrev_table, is_64)) orelse continue; |
| 776 | 765 | const after_die_offset = try seekable.getPos(); |
| 777 | 766 | |
| 778 | 767 | switch (die_obj.tag_id) { |
| 768 | TAG.compile_unit => { |
| 769 | compile_unit = .{ |
| 770 | .version = version, |
| 771 | .is_64 = is_64, |
| 772 | .die = &die_obj, |
| 773 | .pc_range = null, |
| 774 | |
| 775 | .str_offsets_base = if (die_obj.getAttr(AT.str_offsets_base)) |fv| try fv.getUInt(usize) else 0, |
| 776 | .addr_base = if (die_obj.getAttr(AT.addr_base)) |fv| try fv.getUInt(usize) else 0, |
| 777 | .rnglists_base = if (die_obj.getAttr(AT.rnglists_base)) |fv| try fv.getUInt(usize) else 0, |
| 778 | .loclists_base = if (die_obj.getAttr(AT.loclists_base)) |fv| try fv.getUInt(usize) else 0, |
| 779 | }; |
| 780 | }, |
| 779 | 781 | TAG.subprogram, TAG.inlined_subroutine, TAG.subroutine, TAG.entry_point => { |
| 780 | 782 | const fn_name = x: { |
| 781 | 783 | var depth: i32 = 3; |
| ... | ... | @@ -783,7 +785,7 @@ pub const DwarfInfo = struct { |
| 783 | 785 | // Prevent endless loops |
| 784 | 786 | while (depth > 0) : (depth -= 1) { |
| 785 | 787 | if (this_die_obj.getAttr(AT.name)) |_| { |
| 786 | | const name = try this_die_obj.getAttrString(di, AT.name, di.debug_str); |
| 788 | const name = try this_die_obj.getAttrString(di, AT.name, di.debug_str, compile_unit); |
| 787 | 789 | break :x try allocator.dupe(u8, name); |
| 788 | 790 | } else if (this_die_obj.getAttr(AT.abstract_origin)) |_| { |
| 789 | 791 | // Follow the DIE it points to and repeat |
| ... | ... | @@ -816,7 +818,7 @@ pub const DwarfInfo = struct { |
| 816 | 818 | }; |
| 817 | 819 | |
| 818 | 820 | const pc_range = x: { |
| 819 | | if (die_obj.getAttrAddr(di, AT.low_pc)) |low_pc| { |
| 821 | if (die_obj.getAttrAddr(di, AT.low_pc, compile_unit)) |low_pc| { |
| 820 | 822 | if (die_obj.getAttr(AT.high_pc)) |high_pc_value| { |
| 821 | 823 | const pc_end = switch (high_pc_value.*) { |
| 822 | 824 | FormValue.Address => |value| value, |
| ... | ... | @@ -873,23 +875,20 @@ pub const DwarfInfo = struct { |
| 873 | 875 | |
| 874 | 876 | var address_size: u8 = undefined; |
| 875 | 877 | var debug_abbrev_offset: u64 = undefined; |
| 876 | | switch (version) { |
| 877 | | 5 => { |
| 878 | | const unit_type = try in.readInt(u8, di.endian); |
| 879 | | if (unit_type != UT.compile) return badDwarf(); |
| 880 | | address_size = try in.readByte(); |
| 881 | | debug_abbrev_offset = if (is_64) |
| 882 | | try in.readInt(u64, di.endian) |
| 883 | | else |
| 884 | | try in.readInt(u32, di.endian); |
| 885 | | }, |
| 886 | | else => { |
| 887 | | debug_abbrev_offset = if (is_64) |
| 888 | | try in.readInt(u64, di.endian) |
| 889 | | else |
| 890 | | try in.readInt(u32, di.endian); |
| 891 | | address_size = try in.readByte(); |
| 892 | | }, |
| 878 | if (version >= 5) { |
| 879 | const unit_type = try in.readInt(u8, di.endian); |
| 880 | if (unit_type != UT.compile) return badDwarf(); |
| 881 | address_size = try in.readByte(); |
| 882 | debug_abbrev_offset = if (is_64) |
| 883 | try in.readInt(u64, di.endian) |
| 884 | else |
| 885 | try in.readInt(u32, di.endian); |
| 886 | } else { |
| 887 | debug_abbrev_offset = if (is_64) |
| 888 | try in.readInt(u64, di.endian) |
| 889 | else |
| 890 | try in.readInt(u32, di.endian); |
| 891 | address_size = try in.readByte(); |
| 893 | 892 | } |
| 894 | 893 | if (address_size != @sizeOf(usize)) return badDwarf(); |
| 895 | 894 | |
| ... | ... | @@ -905,8 +904,19 @@ pub const DwarfInfo = struct { |
| 905 | 904 | |
| 906 | 905 | if (compile_unit_die.tag_id != TAG.compile_unit) return badDwarf(); |
| 907 | 906 | |
| 908 | | const pc_range = x: { |
| 909 | | if (compile_unit_die.getAttrAddr(di, AT.low_pc)) |low_pc| { |
| 907 | var compile_unit: CompileUnit = .{ |
| 908 | .version = version, |
| 909 | .is_64 = is_64, |
| 910 | .pc_range = null, |
| 911 | .die = compile_unit_die, |
| 912 | .str_offsets_base = if (compile_unit_die.getAttr(AT.str_offsets_base)) |fv| try fv.getUInt(usize) else 0, |
| 913 | .addr_base = if (compile_unit_die.getAttr(AT.addr_base)) |fv| try fv.getUInt(usize) else 0, |
| 914 | .rnglists_base = if (compile_unit_die.getAttr(AT.rnglists_base)) |fv| try fv.getUInt(usize) else 0, |
| 915 | .loclists_base = if (compile_unit_die.getAttr(AT.loclists_base)) |fv| try fv.getUInt(usize) else 0, |
| 916 | }; |
| 917 | |
| 918 | compile_unit.pc_range = x: { |
| 919 | if (compile_unit_die.getAttrAddr(di, AT.low_pc, compile_unit)) |low_pc| { |
| 910 | 920 | if (compile_unit_die.getAttr(AT.high_pc)) |high_pc_value| { |
| 911 | 921 | const pc_end = switch (high_pc_value.*) { |
| 912 | 922 | FormValue.Address => |value| value, |
| ... | ... | @@ -929,12 +939,7 @@ pub const DwarfInfo = struct { |
| 929 | 939 | } |
| 930 | 940 | }; |
| 931 | 941 | |
| 932 | | try di.compile_unit_list.append(allocator, CompileUnit{ |
| 933 | | .version = version, |
| 934 | | .is_64 = is_64, |
| 935 | | .pc_range = pc_range, |
| 936 | | .die = compile_unit_die, |
| 937 | | }); |
| 942 | try di.compile_unit_list.append(allocator, compile_unit); |
| 938 | 943 | |
| 939 | 944 | this_unit_offset += next_offset; |
| 940 | 945 | } |
| ... | ... | @@ -955,7 +960,7 @@ pub const DwarfInfo = struct { |
| 955 | 960 | // specified by DW_AT.low_pc or to some other value encoded |
| 956 | 961 | // in the list itself. |
| 957 | 962 | // If no starting value is specified use zero. |
| 958 | | var base_address = compile_unit.die.getAttrAddr(di, AT.low_pc) catch |err| switch (err) { |
| 963 | var base_address = compile_unit.die.getAttrAddr(di, AT.low_pc, compile_unit.*) catch |err| switch (err) { |
| 959 | 964 | error.MissingDebugInfo => @as(u64, 0), // TODO https://github.com/ziglang/zig/issues/11135 |
| 960 | 965 | else => return err, |
| 961 | 966 | }; |
| ... | ... | @@ -1087,7 +1092,7 @@ pub const DwarfInfo = struct { |
| 1087 | 1092 | const in = &stream.reader(); |
| 1088 | 1093 | const seekable = &stream.seekableStream(); |
| 1089 | 1094 | |
| 1090 | | const compile_unit_cwd = try compile_unit.die.getAttrString(di, AT.comp_dir, di.debug_line_str); |
| 1095 | const compile_unit_cwd = try compile_unit.die.getAttrString(di, AT.comp_dir, di.debug_line_str, compile_unit); |
| 1091 | 1096 | const line_info_offset = try compile_unit.die.getAttrSecOffset(AT.stmt_list); |
| 1092 | 1097 | |
| 1093 | 1098 | try seekable.seekTo(line_info_offset); |
| ... | ... | @@ -1202,7 +1207,7 @@ pub const DwarfInfo = struct { |
| 1202 | 1207 | LNCT.directory_index => e.dir_index = try form_value.getUInt(u32), |
| 1203 | 1208 | LNCT.timestamp => e.mtime = try form_value.getUInt(u64), |
| 1204 | 1209 | LNCT.size => e.size = try form_value.getUInt(u64), |
| 1205 | | LNCT.MD5 => e.md5 = try form_value.getUInt(u128), |
| 1210 | LNCT.MD5 => e.md5 = try form_value.getData16(), |
| 1206 | 1211 | else => continue, |
| 1207 | 1212 | } |
| 1208 | 1213 | } |
| ... | ... | @@ -1240,7 +1245,7 @@ pub const DwarfInfo = struct { |
| 1240 | 1245 | LNCT.directory_index => e.dir_index = try form_value.getUInt(u32), |
| 1241 | 1246 | LNCT.timestamp => e.mtime = try form_value.getUInt(u64), |
| 1242 | 1247 | LNCT.size => e.size = try form_value.getUInt(u64), |
| 1243 | | LNCT.MD5 => e.md5 = try form_value.getUInt(u128), |
| 1248 | LNCT.MD5 => e.md5 = try form_value.getData16(), |
| 1244 | 1249 | else => continue, |
| 1245 | 1250 | } |
| 1246 | 1251 | } |
| ... | ... | @@ -1370,12 +1375,12 @@ pub fn openDwarfDebugInfo(di: *DwarfInfo, allocator: mem.Allocator) !void { |
| 1370 | 1375 | |
| 1371 | 1376 | /// This function is to make it handy to comment out the return and make it |
| 1372 | 1377 | /// into a crash when working on this file. |
| 1373 | | inline fn badDwarf() error{InvalidDebugInfo} { |
| 1378 | fn badDwarf() error{InvalidDebugInfo} { |
| 1374 | 1379 | //std.os.abort(); // can be handy to uncomment when working on this file |
| 1375 | 1380 | return error.InvalidDebugInfo; |
| 1376 | 1381 | } |
| 1377 | 1382 | |
| 1378 | | inline fn missingDwarf() error{MissingDebugInfo} { |
| 1383 | fn missingDwarf() error{MissingDebugInfo} { |
| 1379 | 1384 | //std.os.abort(); // can be handy to uncomment when working on this file |
| 1380 | 1385 | return error.MissingDebugInfo; |
| 1381 | 1386 | } |