struct SymbolizedFrame {
SymbolizedFrame() { }
- void set(const std::shared_ptr<ElfFile>& file, uintptr_t address);
+ void set(const std::shared_ptr<ElfFile>& file,
+ uintptr_t address,
+ Dwarf::LocationInfoMode mode);
+
void clear() { *this = SymbolizedFrame(); }
bool found = false;
fbstring demangledName() const {
return name ? demangle(name) : fbstring();
}
+
private:
std::shared_ptr<ElfFile> file_;
};
class Symbolizer {
public:
- explicit Symbolizer(ElfCacheBase* cache = nullptr);
+ static constexpr Dwarf::LocationInfoMode kDefaultLocationInfoMode =
+ Dwarf::LocationInfoMode::FAST;
+
+ explicit Symbolizer(Dwarf::LocationInfoMode mode = kDefaultLocationInfoMode)
+ : Symbolizer(nullptr, mode) {}
+
+ explicit Symbolizer(ElfCacheBase* cache,
+ Dwarf::LocationInfoMode mode = kDefaultLocationInfoMode);
/**
* Symbolize given addresses.
}
private:
- ElfCacheBase* const cache_ = nullptr;
+ ElfCacheBase* const cache_;
+ const Dwarf::LocationInfoMode mode_;
};
/**
- * Format one address in the way it's usually printer by SymbolizePrinter.
+ * Format one address in the way it's usually printed by SymbolizePrinter.
* Async-signal-safe.
*/
class AddressFormatter {
// Colorize output only if output is printed to a TTY (ANSI escape code)
COLOR_IF_TTY = 1 << 3,
+
+ // Skip frame address information
+ NO_FRAME_ADDRESS = 1 << 4,
};
// NOTE: enum values used as indexes in kColorMap.