cerr<<" backtrace:\n";
const Debug::Backtrace::FrameSeq &frames=exc->get_backtrace().get_frames();
for(Debug::Backtrace::FrameSeq::const_iterator i=frames.begin(); i!=frames.end(); ++i)
- {
- cerr<<" "<<i->address;
- if(!i->symbol.empty())
- cerr<<" in "<<i->symbol;
- cerr<<" from "<<i->file<<'\n';
- }
+ cerr<<" "<<*i<<'\n';
}
#endif
{
const Backtrace::FrameSeq &frames=bt.get_frames();
for(Backtrace::FrameSeq::const_iterator i=frames.begin(); i!=frames.end(); ++i)
- out<<i->address<<" in "<<i->symbol<<" from "<<i->file<<'\n';
+ out<<*i<<'\n';
+
+ return out;
+}
+
+ostream &operator<<(ostream &out, const Backtrace::StackFrame &sf)
+{
+ out<<sf.address;
+ if(!sf.symbol.empty())
+ out<<" in "<<sf.symbol;
+ out<<" from "<<sf.file;
return out;
}
};
std::ostream &operator<<(std::ostream &, const Backtrace &);
+std::ostream &operator<<(std::ostream &, const Backtrace::StackFrame &);
} // namespace Debug
} // namespace Msp