feature. See also
. The project being documented here (as the example) is the Zig library itself.
Unwind.FrameDescriptionEntry
pub const FrameDescriptionEntry = struct
File
Code
pub const FrameDescriptionEntry = struct {
pc_begin: u64,
pc_range: u64,
instructions: []const u8,
fn parse(
fde_vaddr: u64,
fde_bytes: []const u8,
cie: *const CommonInformationEntry,
endian: Endian,
) !FrameDescriptionEntry {
if (cie.segment_selector_size != 0) return error.UnsupportedAddrSize;
var r: Reader = .fixed(fde_bytes);
const pc_begin = try readEhPointer(&r, cie.fde_pointer_enc, cie.addr_size_bytes, .{
.pc_rel_base = fde_vaddr,
}, endian);
const pc_range = switch (try readEhPointerAbs(&r, cie.fde_pointer_enc.type, cie.addr_size_bytes, endian)) {
.unsigned => |x| x,
.signed => |x| cast(u64, x) orelse return bad(),
};
switch (cie.augmentation_kind) {
.none, .gcc_eh => {},
.lsb_z => {
// only contains the LSDA pointer, which we don't care about.
const aug_data_len = try r.takeLeb128(usize);
_ = try r.discardAll(aug_data_len);
},
}
return .{
.pc_begin = pc_begin,
.pc_range = pc_range,
.instructions = r.buffered(),
};
}
}