call_stack.cpp 213 B

12345678910111213141516171819202122
  1. #include <boost/stacktrace.hpp>
  2. #include <iostream>
  3. void test(int frame)
  4. {
  5. if(frame--<=0)
  6. {
  7. std::cout<< boost::stacktrace::stacktrace();
  8. }
  9. else
  10. {
  11. test(frame);
  12. }
  13. }
  14. int main()
  15. {
  16. test(5);
  17. return 0;
  18. }