[][src]Trait solana_rbpf::vm::Executable

pub trait Executable<E: UserDefinedError, I: InstructionMeter>: Send + Sync {
    pub fn get_config(&self) -> &Config;
pub fn get_text_bytes(&self) -> Result<(u64, &[u8]), EbpfError<E>>;
pub fn get_ro_sections(&self) -> Result<Vec<(u64, &[u8])>, EbpfError<E>>;
pub fn get_entrypoint_instruction_offset(
        &self
    ) -> Result<usize, EbpfError<E>>;
pub fn define_bpf_function(&mut self, hash: u32, pc: usize);
pub fn lookup_bpf_function(&self, hash: u32) -> Option<&usize>;
pub fn get_syscall_registry(&self) -> &SyscallRegistry;
pub fn set_syscall_registry(&mut self, syscall_registry: SyscallRegistry);
pub fn get_compiled_program(&self) -> Option<&JitProgram<E, I>>;
pub fn jit_compile(&mut self) -> Result<(), EbpfError<E>>;
pub fn report_unresolved_symbol(
        &self,
        insn_offset: usize
    ) -> Result<u64, EbpfError<E>>;
pub fn get_symbols(
        &self
    ) -> (HashMap<u32, String>, HashMap<usize, (String, usize)>); }

An relocated and ready to execute binary

Required methods

pub fn get_config(&self) -> &Config[src]

Get the configuration settings

pub fn get_text_bytes(&self) -> Result<(u64, &[u8]), EbpfError<E>>[src]

Get the .text section virtual address and bytes

pub fn get_ro_sections(&self) -> Result<Vec<(u64, &[u8])>, EbpfError<E>>[src]

Get a vector of virtual addresses for each read-only section

pub fn get_entrypoint_instruction_offset(&self) -> Result<usize, EbpfError<E>>[src]

Get the entry point offset into the text section

pub fn define_bpf_function(&mut self, hash: u32, pc: usize)[src]

Set a symbol's instruction offset

pub fn lookup_bpf_function(&self, hash: u32) -> Option<&usize>[src]

Get a symbol's instruction offset

pub fn get_syscall_registry(&self) -> &SyscallRegistry[src]

Get the syscall registry

pub fn set_syscall_registry(&mut self, syscall_registry: SyscallRegistry)[src]

Set (overwrite) the syscall registry

pub fn get_compiled_program(&self) -> Option<&JitProgram<E, I>>[src]

Get the JIT compiled program

pub fn jit_compile(&mut self) -> Result<(), EbpfError<E>>[src]

JIT compile the executable

pub fn report_unresolved_symbol(
    &self,
    insn_offset: usize
) -> Result<u64, EbpfError<E>>
[src]

Report information on a symbol that failed to be resolved

pub fn get_symbols(
    &self
) -> (HashMap<u32, String>, HashMap<usize, (String, usize)>)
[src]

Get syscalls and BPF functions (if debug symbols are not stripped)

Loading content...

Implementations

impl<E: UserDefinedError, I: 'static + InstructionMeter> dyn Executable<E, I>[src]

Static constructors for Executable

pub fn from_elf(
    elf_bytes: &[u8],
    verifier: Option<Verifier<E>>,
    config: Config
) -> Result<Box<Self>, EbpfError<E>>
[src]

Creates a post relocaiton/fixup executable from an ELF file

pub fn from_text_bytes(
    text_bytes: &[u8],
    verifier: Option<Verifier<E>>,
    config: Config
) -> Result<Box<Self>, EbpfError<E>>
[src]

Creates a post relocaiton/fixup executable from machine code

Implementors

impl<E: UserDefinedError, I: InstructionMeter> Executable<E, I> for EBpfElf<E, I>[src]

pub fn get_config(&self) -> &Config[src]

Get the configuration settings

pub fn get_text_bytes(&self) -> Result<(u64, &[u8]), EbpfError<E>>[src]

Get the .text section virtual address and bytes

pub fn get_ro_sections(&self) -> Result<Vec<(u64, &[u8])>, EbpfError<E>>[src]

Get a vector of virtual addresses for each read-only section

pub fn get_entrypoint_instruction_offset(&self) -> Result<usize, EbpfError<E>>[src]

Get the entry point offset into the text section

pub fn define_bpf_function(&mut self, hash: u32, pc: usize)[src]

Set a symbol's instruction offset

pub fn lookup_bpf_function(&self, hash: u32) -> Option<&usize>[src]

Get a symbol's instruction offset

pub fn get_syscall_registry(&self) -> &SyscallRegistry[src]

Get the syscall registry

pub fn set_syscall_registry(&mut self, syscall_registry: SyscallRegistry)[src]

Set (overwrite) the syscall registry

pub fn get_compiled_program(&self) -> Option<&JitProgram<E, I>>[src]

Get the JIT compiled program

pub fn jit_compile(&mut self) -> Result<(), EbpfError<E>>[src]

JIT compile the executable

pub fn report_unresolved_symbol(
    &self,
    insn_offset: usize
) -> Result<u64, EbpfError<E>>
[src]

Report information on a symbol that failed to be resolved

pub fn get_symbols(
    &self
) -> (HashMap<u32, String>, HashMap<usize, (String, usize)>)
[src]

Get syscalls and BPF functions (if debug symbols are not stripped)

Loading content...