Skip to content
Snippets Groups Projects

Decode trace symbols only when trace requested (GCC)

Merged Sebastian Hahta requested to merge exception-trace into master
2 files
+ 64
51
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -44,17 +44,25 @@ class exception : public std::exception
return msg_.c_str();
}
const char * trace () const throw () {
return trace_.c_str();
std::string trace() const throw () {
return decode_backtrace();
}
void ignore() const { processed_ = true; }
private:
std::string decode_backtrace() const;
std::string msg_;
std::string trace_;
mutable bool processed_;
#ifdef __GNUC__
static const int TRACE_SIZE_MAX_ = 16;
void* trace_[TRACE_SIZE_MAX_];
int trace_size_;
#endif
};
}
#define FTL_Error(A) (ftl::exception(ftl::Formatter() << __FILE__ << ":" << __LINE__ << ": " << A))
Loading