#pragma once #include namespace NYT::NBacktrace { //////////////////////////////////////////////////////////////////////////////// using TBacktrace = TRange; using TBacktraceBuffer = TMutableRange; //! Obtains a backtrace via a given cursor. /*! * \param buffer is the buffer where the backtrace is written to * \param framesToSkip is the number of top frames to skip * \returns the portion of #buffer that has actually been filled */ template TBacktrace GetBacktrace( TCursor* cursor, TBacktraceBuffer buffer, int framesToSkip); //! Symbolizes a backtrace invoking a given callback for each frame. /*! * \param backtrace Backtrace to symbolize * \param writeCallback Callback to invoke for writing symbolized frames * \param startPC PC to start symbolization from (if null then start with the very first frame) */ void SymbolizeBacktrace( TBacktrace backtrace, const std::function& writeCallback, void* startPC = nullptr); //! Symbolizes a backtrace to a string. /*! * \param backtrace Backtrace to symbolize */ std::string SymbolizeBacktrace(TBacktrace backtrace); //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NBacktrace #define BACKTRACE_INL_H_ #include "backtrace-inl.h" #undef BACKTRACE_INL_H_