Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

getAttrRef

Private Function
std.debug.Dwarf.Die.getAttrRef
fn getAttrRef(self: *const Die, id: u64, unit_offset: u64, unit_len: u64) !u64

Params

  • self: *const Die
  • id: u64
  • unit_offset: u64
  • unit_len: u64

File

debug/Dwarf.zig:251
251
252
253
254
255
256
257
258
    fn getAttrRef(self: *const Die, id: u64, unit_offset: u64, unit_len: u64) !u64 {
        const form_value = self.getAttr(id) orelse return error.MissingDebugInfo;
        return switch (form_value.*) {
            .ref => |offset| if (offset < unit_len) unit_offset + offset else bad(),
            .ref_addr => |addr| addr,
            else => bad(),
        };
    }