| 107 | } |
| 108 | |
| 109 | int run_2(const char* argv[]) { |
| 110 | if (!boost::filesystem::exists("./backtrace.dump")) { |
| 111 | if (std::string(argv[0]).find("noop") == std::string::npos) { |
| 112 | return 21; |
| 113 | } |
| 114 | |
| 115 | boost::stacktrace::stacktrace st = boost::stacktrace::stacktrace::from_dump(std::cin); |
| 116 | if (st) { |
| 117 | return 22; |
| 118 | } |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | //[getting_started_on_program_restart |
| 123 | if (boost::filesystem::exists("./backtrace.dump")) { |
| 124 | // there is a backtrace |
| 125 | std::ifstream ifs("./backtrace.dump"); |
| 126 | |
| 127 | boost::stacktrace::stacktrace st = boost::stacktrace::stacktrace::from_dump(ifs); |
| 128 | std::cout << "Previous run crashed:\n" << st << std::endl; /*<-*/ |
| 129 | |
| 130 | if (!st) { |
| 131 | return 23; |
| 132 | } /*->*/ |
| 133 | |
| 134 | // cleaning up |
| 135 | ifs.close(); |
| 136 | boost::filesystem::remove("./backtrace.dump"); |
| 137 | } |
| 138 | //] |
| 139 | |
| 140 | return 0; |
| 141 | } |
| 142 | |
| 143 | #include <sstream> |
| 144 |
nothing calls this directly
no test coverage detected