Rosetta  2019.47
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
backtrace.hh File Reference

Programmatic backtrace whenever you want it. More...

#include <cassert>
#include <assert.h>
#include <string>

Macros

#define MY__has_include(x)   1
 
#define NORETURN
 
#define debug_assert(condition)   assert( ( condition ) || handle_assert_failure( #condition, __FILE__, __LINE__ ) )
 

Functions

void set_throw_on_next_assertion_failure ()
 Function for unit testing only – if an assertion failure is hit, throw an exception instead of exiting. Don't let me catch you calling this function from anywhere besides a unit test. Punishment will be swift. More...
 
bool maybe_throw_on_next_assertion_failure (char const *condition)
 Throw an exception if set_throw_on_next_assertion_failure was called since the last time this function was called. More...
 
std::string backtrace_string (int skip=0)
 
bool print_backtrace (char const *)
 
bool handle_assert_failure (char const *condition, std::string const &file, int const line)
 

Detailed Description

Programmatic backtrace whenever you want it.

Author
Rhiju Das

Macro Definition Documentation

#define debug_assert (   condition)    assert( ( condition ) || handle_assert_failure( #condition, __FILE__, __LINE__ ) )

Referenced by utility::keys::ClassKeyMap< K, T, C >::activate(), utility::keys::ClassKeyVector< K, T, C >::activate(), utility::graph::Node::add_edge(), utility::graph::UpperEdgeGraph< V, E >::add_edge(), utility::graph::LowMemGraph< _Node, _Edge >::add_edge(), utility::graph::Graph::add_edge(), utility::graph::Digraph::add_edge(), utility::keys::SmallKeyMap< K, T >::add_key(), utility::keys::ClassKeyMap< K, T, C >::add_key(), utility::keys::KeyVector< K, T >::add_key(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::add_key(), utility::keys::ClassKeyVector< K, T, C >::add_key(), utility::graph::Graph::all_pairs_shortest_paths(), basic::angle_in_range(), zinc1_homodimer_setup::apply(), utility::arg_max(), utility::arg_min(), utility::keys::AutoKey< Option >::assign_Key(), utility::keys::UserKey< O, S, C >::assign_Key(), utility::vectorL< L, bool, A >::at(), utility::vectorL< 1, std::string, A >::at(), utility::keys::ClassKeyVector< K, T, C >::at(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::at(), utility::keys::AutoKey< Option >::AutoKey(), utility::keys::KeyVector< K, T >::back(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::back(), utility::keys::ClassKeyVector< K, T, C >::back(), utility::graph::ArrayPool< T >::clear(), utility::keys::VariantKey< K >::code(), utility::graph::DirectedEdgeListElement::const_edge(), utility::graph::EdgeListElement::const_edge(), utility::graph::ArrayPoolElement< T >::copy_array_contents(), copy_asymm_unit_to_other_subunits(), utility::options::ResidueChainVectorOption::copy_from(), utility::options::ScalarOption_T_< PathOptionKey, file::PathName >::copy_from(), utility::options::VectorOption_T_< BooleanVectorOptionKey, bool >::copy_from(), count_analytically_improper_rotational(), count_numerically(), utility::factory::Factory< typename >::create(), utility::graph::ArrayPool< T >::create_new_block(), basic::resource_manager::ResourceManager::create_resource(), numeric::statistics::Dawson(), utility::graph::ArrayPool< T >::deallocate_array(), basic::resource_manager::ResourceManager::deallocate_resource(), utility::graph::delete_all_intragroup_edges(), utility::graph::LowMemGraph< _Node, _Edge >::delete_edge(), utility::graph::DirectedEdge::DirectedEdge(), do_erraser2(), basic::thread_manager::RosettaThreadManager::do_multistage_work_vector_in_threads(), utility::down_cast(), utility::graph::LowMemGraph< _Node, _Edge >::drop_all_edges_for_node(), utility::graph::DirectedEdgeListElement::edge(), utility::graph::EdgeListElement::edge(), utility::graph::Edge::Edge(), numeric::eigenvalue_jacobi(), numeric::eigenvector_jacobi(), supercharge::energy_comparison(), utility::graph::DirectedEdgeList::erase(), utility::graph::EdgeList::erase(), utility::vectorL< L, bool, A >::erase_index(), utility::vectorL< 1, std::string, A >::erase_index(), numeric::statistics::errf(), basic::sampling::orientations::Quaternion::euler(), utility::in_place_list< T >::extract(), utility::graph::find_connected_components(), utility::signals::LinkUnit::fref(), utility::keys::KeyVector< K, T >::front(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::front(), utility::keys::ClassKeyVector< K, T, C >::front(), basic::datacache::DataCache< CacheableData >::get(), basic::datacache::DataCache< CacheableData >::get_const_ptr(), get_max_and_intervals(), utility::graph::LowMemGraph< _Node, _Edge >::get_node(), utility::graph::Edge::get_node(), utility::graph::DirectedEdge::get_node(), utility::graph::Graph::get_node(), utility::graph::Digraph::get_node(), utility::graph::Edge::get_node_index(), utility::graph::DirectedEdge::get_node_index(), utility::xsd_util::get_node_option(), utility::graph::LowMemEdge::get_other_ind(), utility::graph::DirectedEdge::get_other_ind(), utility::graph::Edge::get_other_ind(), utility::graph::LowMemEdge::get_other_node(), utility::graph::DirectedEdge::get_other_node(), utility::graph::Edge::get_other_node(), basic::datacache::DataCache< CacheableData >::get_ptr(), basic::datacache::DataCache< CacheableData >::get_raw_const_ptr(), basic::datacache::DataCache< CacheableData >::get_raw_ptr(), utility::xsd_util::get_tag_name(), utility::keys::VariantKey< K >::id(), utility::keys::VariantKey< K >::identifier(), utility::keys::ClassKeyMap< K, T, C >::index(), utility::keys::SmallKeyMap< K, T >::index(), utility::keys::ClassKeyVector< K, T, C >::index(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::index(), utility::SimulateMPI::index_of_next_message(), utility::graph::DirectedEdgeList::insert(), utility::graph::EdgeList::insert(), utility::keys::KeyLookup< K >::insert(), interface_rmsd(), utility::graph::LowMemEdge::internal_deleted(), utility::graph::LowMemGraph< _Node, _Edge >::internal_get_edge(), invariants_for_cyclic_permutation(), utility::graph::DirectedEdge::is_head_node(), utility::graph::DirectedEdge::is_tail_node(), numeric::DietNode< T >::join_left(), numeric::DietNode< T >::join_right(), utility::keys::KeyLookup< K >::key(), utility::keys::KeyCount::KeyCount(), utility::LexicographicalIterator::LexicographicalIterator(), basic::resource_manager::ResourceManager::loader_type_from_resource_tag(), main(), utility::graph::UEVertex< V, E >::make_edge_vector_current(), make_fragments(), utility::max(), utility::min(), utility::SimulateMPI::mpi_rank(), mutate_random_residue(), utility::graph::ArrayPool< T >::new_array(), utility::keys::AutoKey< Option >::next_index(), basic::sampling::orientations::Quaternion::Normalize(), utility::keys::VariantKey< K >::operator Key &(), utility::keys::VariantKey< K >::operator Key const &(), utility::keys::Key2Vector< K >::operator()(), utility::keys::Key3Vector< K >::operator()(), utility::Bound< file::FileName >::operator()(), utility::keys::Key4Vector< K >::operator()(), utility::keys::VariantKey< K >::operator()(), utility::fixedsizearray1iterator< T, S >::operator*(), utility::fixedsizearray0iterator< T, S >::operator*(), utility::graph::LowMemEdgeListIter::operator*(), utility::graph::LowMemEdgeListConstIter::operator*(), utility::graph::DirectedEdgeListIterator::operator*(), utility::graph::EdgeListIterator::operator*(), utility::fixedsizearray1const_iterator< T, S >::operator*(), utility::fixedsizearray0const_iterator< T, S >::operator*(), utility::graph::DirectedEdgeListConstIterator::operator*(), utility::graph::EdgeListConstIterator::operator*(), utility::fixedsizearray1iterator< T, S >::operator+(), utility::fixedsizearray0iterator< T, S >::operator+(), utility::fixedsizearray1const_iterator< T, S >::operator+(), utility::fixedsizearray0const_iterator< T, S >::operator+(), utility::graph::LowMemEdgeListIter::operator++(), utility::fixedsizearray1iterator< T, S >::operator++(), utility::fixedsizearray0iterator< T, S >::operator++(), utility::graph::LowMemEdgeListConstIter::operator++(), utility::graph::DirectedEdgeListIterator::operator++(), utility::graph::EdgeListIterator::operator++(), utility::fixedsizearray1const_iterator< T, S >::operator++(), utility::fixedsizearray0const_iterator< T, S >::operator++(), utility::graph::DirectedEdgeListConstIterator::operator++(), utility::graph::EdgeListConstIterator::operator++(), utility::fixedsizearray1iterator< T, S >::operator+=(), utility::fixedsizearray0iterator< T, S >::operator+=(), utility::fixedsizearray1const_iterator< T, S >::operator+=(), utility::fixedsizearray0const_iterator< T, S >::operator+=(), utility::fixedsizearray1iterator< T, S >::operator-(), utility::fixedsizearray0iterator< T, S >::operator-(), utility::fixedsizearray1const_iterator< T, S >::operator-(), utility::fixedsizearray0const_iterator< T, S >::operator-(), utility::graph::LowMemEdgeListIter::operator--(), utility::graph::LowMemEdgeListConstIter::operator--(), utility::graph::DirectedEdgeListIterator::operator--(), utility::graph::EdgeListIterator::operator--(), utility::graph::DirectedEdgeListConstIterator::operator--(), utility::graph::EdgeListConstIterator::operator--(), utility::fixedsizearray1iterator< T, S >::operator-=(), utility::fixedsizearray0iterator< T, S >::operator-=(), utility::fixedsizearray1const_iterator< T, S >::operator-=(), utility::fixedsizearray0const_iterator< T, S >::operator-=(), utility::graph::LowMemEdgeListIter::operator->(), utility::graph::LowMemEdgeListConstIter::operator->(), utility::graph::DirectedEdgeListIterator::operator->(), utility::graph::EdgeListIterator::operator->(), utility::graph::DirectedEdgeListConstIterator::operator->(), utility::graph::EdgeListConstIterator::operator->(), utility::OrderedTuple< T >::operator<(), utility::graph::LowMemEdgeListIter::operator==(), utility::OrderedTuple< T >::operator==(), utility::graph::LowMemEdgeListConstIter::operator==(), utility::graph::DirectedEdgeListIterator::operator==(), utility::graph::EdgeListIterator::operator==(), utility::graph::DirectedEdgeListConstIterator::operator==(), utility::graph::EdgeListConstIterator::operator==(), utility::graph::Array0< T >::operator[](), utility::keys::Key2Vector< K >::operator[](), utility::keys::Key3Vector< K >::operator[](), utility::keys::Key4Vector< K >::operator[](), utility::graph::ArrayPoolElement< T >::operator[](), utility::vectorL< L, bool, A >::operator[](), utility::fixedsizearray0< T, S >::operator[](), utility::keys::ClassKeyMap< K, T, C >::operator[](), utility::vectorL< 1, std::string, A >::operator[](), utility::keys::SmallKeyMap< K, T >::operator[](), utility::keys::ClassKeyVector< K, T, C >::operator[](), output_packstat(), basic::sampling::orientations::Permute::Permute(), utility::keys::KeyVector< K, T >::pop_back(), utility::keys::ClassKeyVector< K, T, C >::pop_back(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::pop_back(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_sequence_of_subelement_sets(), basic::database::schema_generator::GreaterThanConstraint::print(), basic::sampling::orientations::QuaternionGrid::print(), utility::keys::VariantKey< K >::private_index(), utility::graph::DirectedEdgeList::push_back(), utility::graph::EdgeList::push_back(), utility::graph::DirectedEdgeList::push_front(), utility::graph::EdgeList::push_front(), basic::sampling::orientations::QuaternionGrid::QuaternionGrid(), read_in_mutations(), basic::resource_manager::ResourceManager::read_resources_from_xml(), basic::resource_manager::ResourceManager::read_resources_tags(), basic::options::read_subset_of_global_option_collection(), utility::SimulateMPI::receive_char_from_node(), utility::SimulateMPI::receive_double_from_node(), utility::SimulateMPI::receive_doubles_from_node(), utility::SimulateMPI::receive_integer_from_node(), utility::SimulateMPI::receive_integers_from_node(), utility::SimulateMPI::receive_size_from_node(), utility::SimulateMPI::receive_sizes_from_node(), utility::SimulateMPI::receive_string_from_node(), utility::tag::XMLSchemaRepeatableCTNode::recursively_write_ct_to_schema(), utility::in_place_list< T >::remove(), run(), FragmentAssemblyMover::run(), ConsensusFragmentMover::run(), utility::signals::LinkUnit::send(), utility::SimulateMPI::send_char_to_node(), utility::SimulateMPI::send_double_to_node(), utility::SimulateMPI::send_doubles_to_node(), utility::SimulateMPI::send_integer_to_node(), utility::SimulateMPI::send_integers_to_node(), utility::SimulateMPI::send_size_to_node(), utility::SimulateMPI::send_sizes_to_node(), utility::SimulateMPI::send_string_to_node(), utility::FixedSizeLexicographicalIterator< S >::set_dimension_sizes(), utility::in_place_list< T >::set_head(), utility::graph::UEVertex< V, E >::set_index_and_owner(), utility::SimulateMPI::set_mpi_rank(), utility::graph::Edge::set_pos_in_owners_list(), utility::graph::DirectedEdge::set_pos_in_owners_list(), utility::in_place_list< T >::set_tail(), numeric::MathNTensor< double, 2 >::set_value(), DougsDockDesignMinimizeMagicMover::setup_pert_foldtree(), utility::string2uint(), utility::vectorL< L, bool, A >::u(), utility::vectorL< 1, std::string, A >::u(), utility::keys::UserKey< O, S, C >::UserKey(), utility::Bound< file::FileName >::value(), numeric::MathNTensor< double, 2 >::value(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::write_complex_type_to_schema(), and utility::tag::XMLSchemaElement::write_definition().

#define MY__has_include (   x)    1
#define NORETURN

Function Documentation

std::string backtrace_string ( int  skip = 0)
inline
bool handle_assert_failure ( char const *  condition,
std::string const &  file,
int const  line 
)
bool maybe_throw_on_next_assertion_failure ( char const *  condition)

Throw an exception if set_throw_on_next_assertion_failure was called since the last time this function was called.

References CREATE_EXCEPTION, and throw_the_next_time_an_assertion_failure_is_hit().

Referenced by utility::exit_handler(), and handle_assert_failure().

bool print_backtrace ( char const *  )
inline
void set_throw_on_next_assertion_failure ( )

Function for unit testing only – if an assertion failure is hit, throw an exception instead of exiting. Don't let me catch you calling this function from anywhere besides a unit test. Punishment will be swift.

References throw_the_next_time_an_assertion_failure_is_hit().