blob: f4a2bbf56f7ba06574792aac30e06a2b9053e4e7 [file]
#ifndef THIRD_PARTY_GBMCWEB_INCLUDE_EXCEPTION_STACK_TRACER_INTERNAL_HPP_
#define THIRD_PARTY_GBMCWEB_INCLUDE_EXCEPTION_STACK_TRACER_INTERNAL_HPP_
// Internal surface of the exception stack tracer, exposed only so unit tests
// can exercise the record lookup and terminate-formatting logic in-process.
// The production terminate handler aborts the process, so exercising that logic
// solely through death tests keeps it out of coverage (a forked child that
// abort()s never flushes gcov counters) and makes it awkward to assert on.
// This is not part of the public API; do not use outside the tracer.
namespace exception_stack_tracer_internal {
// Logs "terminate: <type>", the exception's what(), and the recorded
// throw-site stack (or an "unavailable" line) for the exception currently being
// handled. Safe to call with no active exception (logs that and returns).
// Shared by the real terminate handler and the unit tests.
void logThrowSiteStackOfCurrentException();
// Restores recording state for hermetic tests: re-enables tracing, empties the
// throw ring, and forces the module table to be re-snapshotted on the next
// installExceptionStackTracer(true) call.
void resetForTest();
} // namespace exception_stack_tracer_internal
#endif // THIRD_PARTY_GBMCWEB_INCLUDE_EXCEPTION_STACK_TRACER_INTERNAL_HPP_