CommonLib
Loading...
Searching...
No Matches
hedgedev::csl::diag::this_process Namespace Reference

Functions

template<ut::expr::any_string T>
std::vector< T > get_command_line ()
std::filesystem::path get_executable_path ()
std::filesystem::path get_module_path_from_address (const void *in_address)
std::filesystem::path get_working_directory ()
std::vector< stack_frame > get_stack_trace (const void *in_context, const size_t in_max_frames)
bool has_address (const void *in_address)
template<ut::expr::any_string T>
bool restart (const std::vector< T > &in_args)
bool restart ()
std::filesystem::path get_executable_root ()
bool is_neighbour (const std::filesystem::path &in_path)

Function Documentation

◆ get_command_line()

template<ut::expr::any_string T>
std::vector< T > hedgedev::csl::diag::this_process::get_command_line ( )
inline

Gets the command line arguments that were passed into this process at launch.

◆ get_executable_path()

std::filesystem::path hedgedev::csl::diag::this_process::get_executable_path ( )
inline

Gets the path to the executable this process started from.

◆ get_executable_root()

std::filesystem::path hedgedev::csl::diag::this_process::get_executable_root ( )
inline

Gets the path to the directory containing executable this process started from.

◆ get_module_path_from_address()

std::filesystem::path hedgedev::csl::diag::this_process::get_module_path_from_address ( const void * in_address)
inline

Gets the path to the module containing the specified address.

Parameters
in_addressThe address to search for.

◆ get_stack_trace()

std::vector< stack_frame > hedgedev::csl::diag::this_process::get_stack_trace ( const void * in_context,
const size_t in_max_frames = 0 )
inline

Gets a stack trace.

Parameters
in_contextA pointer to a CPU context structure.
in_max_framesThe maximum number of stack frames to capture.
Returns
A collection of stack frames.

◆ get_working_directory()

std::filesystem::path hedgedev::csl::diag::this_process::get_working_directory ( )
inline

Gets the working directory of this process.

◆ has_address()

bool hedgedev::csl::diag::this_process::has_address ( const void * in_address)
inline

Checks if this process is the owner of the specified address.

Parameters
in_addressThe address to search for.
Returns
true if the address is inside this process' memory. Otherwise, false.

◆ is_neighbour()

bool hedgedev::csl::diag::this_process::is_neighbour ( const std::filesystem::path & in_path)
inline

Checks if a path is in the same directory as the executable this process started from.

Parameters
in_pathThe path to check.
Returns
true if both paths are in the same directory. Otherwise, false.

◆ restart() [1/2]

bool hedgedev::csl::diag::this_process::restart ( )
inline

Restarts this process.

Returns
true if this process was terminated successfully. Otherwise, false.

◆ restart() [2/2]

template<ut::expr::any_string T>
bool hedgedev::csl::diag::this_process::restart ( const std::vector< T > & in_args)
inline

Restarts this process.

Template Parameters
TThe string type for the arguments.
Parameters
in_argsThe command line arguments to pass into the new process.
Returns
true if this process was terminated successfully. Otherwise, false.