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 #include <cstdlib> 8 #include <string> 9 10 #include <boost/config.hpp> 11 #include <unwind.h> 12 #include <sys/types.h> 13 #include <sys/wait.h> 14 main()15int main() { 16 17 #ifdef BOOST_STACKTRACE_ADDR2LINE_LOCATION 18 std::string s = BOOST_STRINGIZE( BOOST_STACKTRACE_ADDR2LINE_LOCATION ); 19 s += " -h"; 20 #else 21 std::string s = "/usr/bin/addr2line -h"; 22 #endif 23 24 return std::system(s.c_str()); 25 } 26