commit 51eb4ebec1435dc0050bd1d40c48416019972e65 (tree)
parent 38492b2ea4b7aac9685ede264701ac0b7bb291c0
Author: LemonBoy <thatlemon@gmail.com>
Date: Thu, 11 Apr 2019 15:41:42 +0200
Distinguish between absolute/relative addresses
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/std/debug.zig b/std/debug.zig
@@ -1243,6 +1243,7 @@ const FormValue = union(enum) {
ExprLoc: []u8,
Flag: bool,
SecOffset: u64,
+ Ref: u64,
RefAddr: u64,
String: []u8,
StrPtr: u64,
@@ -1465,7 +1466,7 @@ fn parseFormValueTargetAddrSize(in_stream: var) !u64 {
fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, size: i32) !FormValue {
return FormValue{
- .RefAddr = switch (size) {
+ .Ref = switch (size) {
1 => try in_stream.readIntLittle(u8),
2 => try in_stream.readIntLittle(u16),
4 => try in_stream.readIntLittle(u32),
@@ -1510,7 +1511,7 @@ fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, is_64
DW.FORM_ref_udata => parseFormValueRef(allocator, in_stream, -1),
DW.FORM_ref_addr => FormValue{ .RefAddr = try parseFormValueDwarfOffsetSize(in_stream, is_64) },
- DW.FORM_ref_sig8 => FormValue{ .RefAddr = try in_stream.readIntLittle(u64) },
+ DW.FORM_ref_sig8 => FormValue{ .Ref = try in_stream.readIntLittle(u64) },
DW.FORM_string => FormValue{ .String = try readStringRaw(allocator, in_stream) },
DW.FORM_strp => FormValue{ .StrPtr = try parseFormValueDwarfOffsetSize(in_stream, is_64) },