extern "C" {
StackTraceStack* getExceptionStackTraceStack(void) __attribute__((__weak__));
-typedef StackTraceStack* (*GetExceptionStackTraceStackType)(void);
+typedef StackTraceStack* (*GetExceptionStackTraceStackType)();
GetExceptionStackTraceStackType getExceptionStackTraceStackFn;
}
-} // namespace
+} // namespace
namespace folly {
namespace exception_tracer {
out << "(unknown type)";
}
out << " (" << info.frames.size()
- << (info.frames.size() == 1 ? " frame" : " frames")
- << ")\n";
+ << (info.frames.size() == 1 ? " frame" : " frames") << ")\n";
try {
size_t frameCount = info.frames.size();
bool isAbiCppException(const __cxa_exception* exc) {
// The least significant four bytes must be "C++\0"
static const uint64_t cppClass =
- ((uint64_t)'C' << 24) |
- ((uint64_t)'+' << 16) |
- ((uint64_t)'+' << 8);
+ ((uint64_t)'C' << 24) | ((uint64_t)'+' << 16) | ((uint64_t)'+' << 8);
return (exc->unwindHeader.exception_class & 0xffffffff) == cppClass;
}
-} // namespace
+} // namespace
std::vector<ExceptionInfo> getCurrentExceptions() {
struct Once {
if (!getExceptionStackTraceStackFn) {
// Nope, see if it's in a shared library
- getExceptionStackTraceStackFn =
- (GetExceptionStackTraceStackType)dlsym(
- RTLD_NEXT, "getExceptionStackTraceStack");
+ getExceptionStackTraceStackFn = (GetExceptionStackTraceStackType)dlsym(
+ RTLD_NEXT, "getExceptionStackTraceStack");
}
}
};
static bool logged = false;
if (!logged) {
LOG(WARNING)
- << "Exception tracer library not linked, stack traces not available";
+ << "Exception tracer library not linked, stack traces not available";
logged = true;
}
} else if ((traceStack = getExceptionStackTraceStackFn()) == nullptr) {
static bool logged = false;
if (!logged) {
LOG(WARNING)
- << "Exception stack trace invalid, stack traces not available";
+ << "Exception stack trace invalid, stack traces not available";
logged = true;
}
}
// standard ABI __cxa_exception objects, and are correctly labeled as
// such in the exception_class field. We could try to extract the
// primary exception type in horribly hacky ways, but, for now, nullptr.
- info.type =
- isAbiCppException(currentException) ?
- currentException->exceptionType :
- nullptr;
+ info.type = isAbiCppException(currentException)
+ ? currentException->exceptionType
+ : nullptr;
if (traceStack) {
LOG_IF(DFATAL, !trace)
origUnexpected();
}
-} // namespace
+} // namespace
void installHandlers() {
struct Once {
static Once once;
}
-} // namespace exception_tracer
-} // namespace folly
+} // namespace exception_tracer
+} // namespace folly