Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Function template symbol_location_ptr

boost::dll::symbol_location_ptr

Synopsis

// In header: <boost/dll/runtime_symbol_info.hpp>


template<typename T> 
  boost::dll::fs::path 
  symbol_location_ptr(T ptr_to_symbol, boost::dll::fs::error_code & ec);

Description

On success returns full path and name to the binary object that holds symbol pointed by ptr_to_symbol.

Examples:

int main() {
   dll::symbol_location_ptr(std::set_terminate(0));       // returns "/some/path/libmy_terminate_handler.so"
   dll::symbol_location_ptr(::signal(SIGSEGV, SIG_DFL));  // returns "/some/path/libmy_symbol_handler.so"
}

Parameters:

ptr_to_symbol

Pointer to symbol which location is to be determined.

ec

Variable that will be set to the result of the operation.

Returns:

Path to the binary object that holds symbol or empty path in case error.

Throws:

std::bad_alloc in case of insufficient memory. Overload that does not accept boost::dll::fs::error_code also throws boost::dll::fs::system_error.

PrevUpHomeNext