authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-03-09 21:05:41-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-03-10 01:38:40-05:00
log61a02d9d1e1a35469530a47f4aa710ac49e6efae
treef7d7afd464fe4e2773e0a7817030502a3d2854ae
parentf25c1c6858ea12068242b16c8a6765d7312956cc

omit pad zeroes in debug stack traces


1 files changed, 1 insertions(+), 3 deletions(-)

std/debug/index.zig+1-3
...@@ -179,9 +179,7 @@ pub fn writeCurrentStackTrace(out_stream: var, allocator: &mem.Allocator,...@@ -179,9 +179,7 @@ pub fn writeCurrentStackTrace(out_stream: var, allocator: &mem.Allocator,
179}179}
180180
181fn printSourceAtAddress(debug_info: &ElfStackTrace, out_stream: var, address: usize) !void {181fn printSourceAtAddress(debug_info: &ElfStackTrace, out_stream: var, address: usize) !void {
182 // TODO we really should be able to convert @sizeOf(usize) * 2 to a string literal182 const ptr_hex = "0x{x}";
183 // at compile time. I'll call it issue #313
184 const ptr_hex = if (@sizeOf(usize) == 4) "0x{x8}" else "0x{x16}";
185183
186 switch (builtin.os) {184 switch (builtin.os) {
187 builtin.Os.windows => return error.UnsupportedDebugInfo,185 builtin.Os.windows => return error.UnsupportedDebugInfo,