Zig 0.17.0-dev (Split by item) 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.
std › debug › Dwarf › Unwind › VirtualMachine › runTo Public Function runTo Doc Source Public Function std.debug.Dwarf.Unwind.VirtualMachine.runTo
pub fn runTo (
vm : *VirtualMachine ,
gpa : Allocator ,
pc : u64 ,
cie : *const Unwind .CommonInformationEntry ,
fde : *const Unwind .FrameDescriptionEntry ,
addr_size_bytes : u8 ,
endian : std .builtin .Endian ,
) !Row Params File debug/Dwarf/Unwind/VirtualMachine.zig: 131
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173 pub fn runTo (
vm : *VirtualMachine ,
gpa : Allocator ,
pc : u64 ,
cie : *const Unwind .CommonInformationEntry ,
fde : *const Unwind .FrameDescriptionEntry ,
addr_size_bytes : u8 ,
endian : std .builtin .Endian ,
) !Row {
assert (vm .cie_row == null );
const target_offset = pc - fde .pc_begin ;
assert (target_offset < fde .pc_range );
const instruction_bytes : []const u8 = insts : {
if (target_offset < cie .last_row .?.offset ) {
break :insts cie .initial_instructions ;
}
// This is the more common case: start from the CIE's last row.
assert (vm .columns .items .len == 0 );
vm .current_row = .{
.offset = cie .last_row .?.offset ,
.cfa = cie .last_row .?.cfa ,
.columns = .{
.start = 0 ,
.len = @intCast (cie .last_row .?.cols .len ),
},
};
try vm .columns .appendSlice (gpa , cie .last_row .?.cols );
vm .cie_row = vm .current_row ;
break :insts fde .instructions ;
};
try vm .evalInstructions (
gpa ,
cie ,
target_offset ,
instruction_bytes ,
addr_size_bytes ,
endian ,
);
return vm .current_row ;
}
Runs the CIE instructions, then the FDE instructions. Execution halts once the row that corresponds to
pcis known, and the row is returned.