• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright Antony Polukhin, 2016-2020.
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
8 #define BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
9 
10 #include <boost/config.hpp>
11 #ifdef BOOST_HAS_PRAGMA_ONCE
12 #   pragma once
13 #endif
14 
15 #include <boost/stacktrace/frame.hpp>
16 
17 namespace boost { namespace stacktrace { namespace detail {
18 
19 struct to_string_using_nothing {
20     std::string res;
21 
prepare_function_nameboost::stacktrace::detail::to_string_using_nothing22     void prepare_function_name(const void* addr) {
23         res = boost::stacktrace::frame(addr).name();
24     }
25 
prepare_source_locationboost::stacktrace::detail::to_string_using_nothing26     bool prepare_source_location(const void* /*addr*/) const BOOST_NOEXCEPT {
27         return false;
28     }
29 };
30 
31 template <class Base> class to_string_impl_base;
32 typedef to_string_impl_base<to_string_using_nothing> to_string_impl;
33 
name_impl(const void *)34 inline std::string name_impl(const void* /*addr*/) {
35     return std::string();
36 }
37 
38 } // namespace detail
39 
source_file() const40 std::string frame::source_file() const {
41     return std::string();
42 }
43 
source_line() const44 std::size_t frame::source_line() const {
45     return 0;
46 }
47 
48 }} // namespace boost::stacktrace
49 
50 #endif // BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
51