diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-05-29 03:22:52 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-05-29 03:22:52 -0400 |
| commit | cb042c8343eb94a8d149fe1f5d69aa2746aa85d0 (patch) | |
| tree | 36b9711c480b61c372c86bc47dd20a635d624d3a /std/debug | |
| parent | 7fa97b752e167de6df9a8a76999456d2c199b345 (diff) | |
| parent | eda6898c5b253367174172db909ee23013f32733 (diff) | |
| download | zig-cb042c8343eb94a8d149fe1f5d69aa2746aa85d0.tar.gz zig-cb042c8343eb94a8d149fe1f5d69aa2746aa85d0.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'std/debug')
| -rw-r--r-- | std/debug/failing_allocator.zig | 4 | ||||
| -rw-r--r-- | std/debug/index.zig | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/std/debug/failing_allocator.zig b/std/debug/failing_allocator.zig index f876b7902d..6b5edff5bf 100644 --- a/std/debug/failing_allocator.zig +++ b/std/debug/failing_allocator.zig @@ -13,14 +13,14 @@ pub const FailingAllocator = struct { deallocations: usize, pub fn init(allocator: &mem.Allocator, fail_index: usize) FailingAllocator { - return FailingAllocator { + return FailingAllocator{ .internal_allocator = allocator, .fail_index = fail_index, .index = 0, .allocated_bytes = 0, .freed_bytes = 0, .deallocations = 0, - .allocator = mem.Allocator { + .allocator = mem.Allocator{ .allocFn = alloc, .reallocFn = realloc, .freeFn = free, diff --git a/std/debug/index.zig b/std/debug/index.zig index 36ac2e8a3f..92e565b391 100644 --- a/std/debug/index.zig +++ b/std/debug/index.zig @@ -227,8 +227,7 @@ fn printSourceAtAddress(debug_info: &ElfStackTrace, out_stream: var, address: us else => return err, } } else |err| switch (err) { - error.MissingDebugInfo, - error.InvalidDebugInfo => { + error.MissingDebugInfo, error.InvalidDebugInfo => { try out_stream.print(ptr_hex ++ " in ??? ({})\n", address, compile_unit_name); }, else => return err, @@ -597,10 +596,12 @@ fn parseFormValueBlock(allocator: &mem.Allocator, in_stream: var, size: usize) ! } fn parseFormValueConstant(allocator: &mem.Allocator, in_stream: var, signed: bool, size: usize) !FormValue { - return FormValue{ .Const = Constant{ - .signed = signed, - .payload = try readAllocBytes(allocator, in_stream, size), - } }; + return FormValue{ + .Const = Constant{ + .signed = signed, + .payload = try readAllocBytes(allocator, in_stream, size), + }, + }; } fn parseFormValueDwarfOffsetSize(in_stream: var, is_64: bool) !u64 { @@ -621,7 +622,7 @@ fn parseFormValueRef(allocator: &mem.Allocator, in_stream: var, comptime T: type return parseFormValueRefLen(allocator, in_stream, block_len); } -const ParseFormValueError = error { +const ParseFormValueError = error{ EndOfStream, Io, BadFd, @@ -645,8 +646,7 @@ fn parseFormValue(allocator: &mem.Allocator, in_stream: var, form_id: u64, is_64 DW.FORM_data2 => parseFormValueConstant(allocator, in_stream, false, 2), DW.FORM_data4 => parseFormValueConstant(allocator, in_stream, false, 4), DW.FORM_data8 => parseFormValueConstant(allocator, in_stream, false, 8), - DW.FORM_udata, - DW.FORM_sdata => { + DW.FORM_udata, DW.FORM_sdata => { const block_len = try readULeb128(in_stream); const signed = form_id == DW.FORM_sdata; return parseFormValueConstant(allocator, in_stream, signed, block_len); |
