aboutsummaryrefslogtreecommitdiff
path: root/std/debug.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-31 17:10:29 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-31 17:10:29 -0500
commit69132bdeda9f9ee672d883fd442b6158d8725422 (patch)
tree29b1bfd8acbab82442f83bbad2d06d0eea0d7f35 /std/debug.zig
parent5f89393acb0e3626d942302ca24de14349850040 (diff)
downloadzig-69132bdeda9f9ee672d883fd442b6158d8725422.tar.gz
zig-69132bdeda9f9ee672d883fd442b6158d8725422.zip
IR: progress toward compiling standard library
* comptime fn call * is_comptime doesn't count as an instruction dependency * update more std code to latest zig
Diffstat (limited to 'std/debug.zig')
-rw-r--r--std/debug.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/std/debug.zig b/std/debug.zig
index 05e895db5d..a5213dfbea 100644
--- a/std/debug.zig
+++ b/std/debug.zig
@@ -35,7 +35,7 @@ pub fn writeStackTrace(out_stream: &io.OutStream) -> %void {
defer st.self_exe_stream.close() %% {};
%return st.elf.openStream(&global_allocator, &st.self_exe_stream);
- defer %return st.elf.close();
+ defer st.elf.close();
st.debug_info = (%return st.elf.findSection(".debug_info")) ?? return error.MissingDebugInfo;
st.debug_abbrev = (%return st.elf.findSection(".debug_abbrev")) ?? return error.MissingDebugInfo;
@@ -154,7 +154,7 @@ const Die = struct {
fn getAttrAddr(self: &const Die, id: u64) -> %u64 {
const form_value = self.getAttr(id) ?? return error.InvalidDebugInfo;
return switch (*form_value) {
- Address => |value| value,
+ FormValue.Address => |value| value,
else => error.InvalidDebugInfo,
};
}
@@ -162,7 +162,7 @@ const Die = struct {
fn getAttrUnsignedLe(self: &const Die, id: u64) -> %u64 {
const form_value = self.getAttr(id) ?? return error.InvalidDebugInfo;
return switch (*form_value) {
- Const => |value| value.asUnsignedLe(),
+ FormValue.Const => |value| value.asUnsignedLe(),
else => error.InvalidDebugInfo,
};
}
@@ -170,8 +170,8 @@ const Die = struct {
fn getAttrString(self: &const Die, st: &ElfStackTrace, id: u64) -> %[]u8 {
const form_value = self.getAttr(id) ?? return error.InvalidDebugInfo;
return switch (*form_value) {
- String => |value| value,
- StrPtr => |offset| getString(st, offset),
+ FormValue.String => |value| value,
+ FormValue.StrPtr => |offset| getString(st, offset),
else => error.InvalidDebugInfo,
}
}
@@ -406,8 +406,8 @@ fn scanAllCompileUnits(st: &ElfStackTrace) -> %void {
const high_pc_value = compile_unit_die.getAttr(DW.AT_high_pc) ?? return error.MissingDebugInfo;
const pc_end = switch (*high_pc_value) {
- Address => |value| value,
- Const => |value| {
+ FormValue.Address => |value| value,
+ FormValue.Const => |value| {
const offset = %return value.asUnsignedLe();
low_pc + offset
},