Function runTo [src]

Runs the CIE instructions, then the FDE instructions. Execution halts once the row that corresponds to pc is known, and the row is returned.

Prototype

pub fn runTo( self: *VirtualMachine, allocator: std.mem.Allocator, pc: u64, cie: std.debug.Dwarf.CommonInformationEntry, fde: std.debug.Dwarf.FrameDescriptionEntry, addr_size_bytes: u8, endian: std.builtin.Endian, ) !Row

Parameters

self: *VirtualMachineallocator: std.mem.Allocatorpc: u64cie: std.debug.Dwarf.CommonInformationEntryfde: std.debug.Dwarf.FrameDescriptionEntryaddr_size_bytes: u8endian: std.builtin.Endian

Source

pub fn runTo( self: *VirtualMachine, allocator: std.mem.Allocator, pc: u64, cie: std.debug.Dwarf.CommonInformationEntry, fde: std.debug.Dwarf.FrameDescriptionEntry, addr_size_bytes: u8, endian: std.builtin.Endian, ) !Row { assert(self.cie_row == null); if (pc < fde.pc_begin or pc >= fde.pc_begin + fde.pc_range) return error.AddressOutOfRange; var prev_row: Row = self.current_row; var cie_stream = std.io.fixedBufferStream(cie.initial_instructions); var fde_stream = std.io.fixedBufferStream(fde.instructions); var streams = [_]*std.io.FixedBufferStream([]const u8){ &cie_stream, &fde_stream, }; for (&streams, 0..) |stream, i| { while (stream.pos < stream.buffer.len) { const instruction = try std.debug.Dwarf.call_frame.Instruction.read(stream, addr_size_bytes, endian); prev_row = try self.step(allocator, cie, i == 0, instruction); if (pc < fde.pc_begin + self.current_row.offset) return prev_row; } } return self.current_row; }