37 namespace symbolizer {
48 const std::shared_ptr<ElfFile>& file,
57 const char*
name =
nullptr;
75 size_t frameCount = 0;
76 uintptr_t addresses[N];
129 size_t symbolCacheSize = 0);
134 const uintptr_t* addresses,
147 symbolize(&address, &frame, 1);
173 static constexpr
char bufTemplate[] =
" @ 0000000000000000";
174 char buf_[
sizeof(bufTemplate)];
196 const uintptr_t* addresses,
228 NO_FILE_AND_LINE = 1 << 0,
237 COLOR_IF_TTY = 1 << 3,
240 NO_FRAME_ADDRESS = 1 << 4,
244 enum Color { DEFAULT, RED, GREEN,
YELLOW, BLUE, CYAN, WHITE, PURPLE, NUM };
249 : options_(options), isTty_(isTty) {}
258 static constexpr std::array<const char*, Color::NUM> kColorMap = {{
291 virtual void flush()
override;
323 return buf_.toStdString();
353 static constexpr
size_t kDefaultMinSignalSafeElfCacheSize = 500;
356 size_t minSignalSafeElfCacheSize = kDefaultMinSignalSafeElfCacheSize,
357 int fd = STDERR_FILENO);
379 virtual void printSymbolizedStackTrace();
399 static constexpr
size_t kDefaultSymbolCacheSize = 10000;
402 std::unique_ptr<SymbolizePrinter> printer,
403 size_t elfCacheSize = 0,
404 size_t symbolCacheSize = kDefaultSymbolCacheSize);
436 void printSymbolizedStackTrace()
override;
437 const long pageSizeUnchecked_ = sysconf(_SC_PAGESIZE);
const fbstring & fbstr() const
bool symbolize(uintptr_t address, SymbolizedFrame &frame)
const std::unique_ptr< SymbolizePrinter > printer_
#define FOLLY_ALWAYS_INLINE
ssize_t getStackTraceSafe(uintptr_t *addresses, size_t maxAddresses)
virtual ~SafeStackTracePrinter()
Dwarf::LocationInfo location
const std::unique_ptr< ElfCache > elfCache_
constexpr detail::Map< Move > move
Symbolizer(Dwarf::LocationInfoMode mode=kDefaultLocationInfoMode)
const Dwarf::LocationInfoMode mode_
std::unique_ptr< IOBuf > buffer_
—— Concurrent Priority Queue Implementation ——
detail::Skip skip(size_t count)
void println(const FrameArray< N > &fa, size_t skip=0)
folly::Optional< PskKeyExchangeMode > mode
std::shared_ptr< ElfFile > file_
ssize_t getStackTrace(uintptr_t *addresses, size_t maxAddresses)
const int kMaxStackTraceDepth
ElfCacheBase *const cache_
SymbolizePrinter(int options, bool isTty=false)
SymbolizedFrame frames[N]
bool fixFrameArray(FrameArray< N > &fa, ssize_t n)
void print(StringPiece sp)
fbstring demangledName() const
folly::Optional< Synchronized< SymbolCache > > symbolCache_
StringSymbolizePrinter(int options=0)
virtual ~SymbolizePrinter()
SignalSafeElfCache elfCache_
Formatter< false, Args... > format(StringPiece fmt, Args &&...args)
std::unique_ptr< FrameArray< kMaxStackTraceDepth > > addresses_
basic_fbstring< char > fbstring
GMockOutputTest ExpectedCall FILE
void print(StringPiece sp)
void symbolize(FrameArray< N > &fa)
fbstring demangle(const char *name)
FDSymbolizePrinter printer_