AsmGrader 0.0.0
Loading...
Searching...
No Matches
asmgrader::Program Class Reference

#include <program.hpp>

Inheritance diagram for asmgrader::Program:
[legend]

Public Member Functions

 Program (std::filesystem::path path, std::vector< std::string > args={})
 
 Program (Program &&other)=default
 
Programoperator= (Program &&rhs)=default
 
 ~Program ()=default
 
Result< RunResultrun ()
 
TracedSubprocessget_subproc ()
 
const TracedSubprocessget_subproc () const
 
SymbolTableget_symtab ()
 
const SymbolTableget_symtab () const
 
const std::filesystem::path & get_path () const
 
const std::vector< std::string > & get_args () const
 
template<typename Func , typename... Args>
Result< typename FunctionTraits< Func >::Ret > call_function (std::string_view name, Args &&... args)
 Returns the result of the function call, or nullopt if the symbol name was not found or some other error occured.
 
template<typename Func , typename... Args>
Result< typename FunctionTraits< Func >::Ret > call_function (std::uintptr_t addr, Args &&... args)
 
std::uintptr_t alloc_mem (std::size_t amt)
 

Static Public Member Functions

static Expected< void, std::string > check_is_elf (const std::filesystem::path &path)
 

Constructor & Destructor Documentation

◆ Program() [1/2]

asmgrader::Program::Program ( std::filesystem::path path,
std::vector< std::string > args = {} )
explicit

◆ Program() [2/2]

asmgrader::Program::Program ( Program && other)
default

◆ ~Program()

asmgrader::Program::~Program ( )
default

Member Function Documentation

◆ alloc_mem()

std::uintptr_t asmgrader::Program::alloc_mem ( std::size_t amt)

◆ call_function() [1/2]

template<typename Func , typename... Args>
Result< typename FunctionTraits< Func >::Ret > asmgrader::Program::call_function ( std::string_view name,
Args &&... args )

Returns the result of the function call, or nullopt if the symbol name was not found or some other error occured.

◆ call_function() [2/2]

template<typename Func , typename... Args>
Result< typename FunctionTraits< Func >::Ret > asmgrader::Program::call_function ( std::uintptr_t addr,
Args &&... args )

◆ check_is_elf()

Expected< void, std::string > asmgrader::Program::check_is_elf ( const std::filesystem::path & path)
static

◆ get_args()

const std::vector< std::string > & asmgrader::Program::get_args ( ) const

◆ get_path()

const std::filesystem::path & asmgrader::Program::get_path ( ) const

◆ get_subproc() [1/2]

TracedSubprocess & asmgrader::Program::get_subproc ( )

◆ get_subproc() [2/2]

const TracedSubprocess & asmgrader::Program::get_subproc ( ) const

◆ get_symtab() [1/2]

SymbolTable & asmgrader::Program::get_symtab ( )

◆ get_symtab() [2/2]

const SymbolTable & asmgrader::Program::get_symtab ( ) const

◆ operator=()

Program & asmgrader::Program::operator= ( Program && rhs)
default

◆ run()

Result< RunResult > asmgrader::Program::run ( )

The documentation for this class was generated from the following files: