| 34 | } |
| 35 | |
| 36 | OutputProxy outputStack(StackCapture stack) { |
| 37 | return OutputProxy([stack = std::move(stack)](std::ostream & os) { |
| 38 | char** symbols = backtrace_symbols(stack.first.ptr(), stack.second); |
| 39 | for (size_t i = 0; i < stack.second; ++i) { |
| 40 | os << symbols[i]; |
| 41 | if (i + 1 < stack.second) |
| 42 | os << std::endl; |
| 43 | } |
| 44 | |
| 45 | if (stack.second == StackLimit) |
| 46 | os << std::endl << "[Stack Output Limit Reached]"; |
| 47 | |
| 48 | ::free(symbols); |
| 49 | }); |
| 50 | } |
| 51 | |
| 52 | StarException::StarException() noexcept |
| 53 | : StarException(std::string("StarException")) {} |
no test coverage detected