X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_model.hpp;h=ba7c845362e55fdc5aae14fe42a4597fada84e49;hb=a85c9e5b6c6be63a1c40f5be927fcec28f8255e4;hp=36f0a03eff83cb15d5919fb86b661eb0cd271513;hpb=abaef29db0cf1a3e2adb0c254886162368b1645a;p=apitrace diff --git a/common/trace_model.hpp b/common/trace_model.hpp index 36f0a03..ba7c845 100644 --- a/common/trace_model.hpp +++ b/common/trace_model.hpp @@ -36,6 +36,7 @@ #include #include +#include namespace trace { @@ -388,6 +389,22 @@ struct RawStackFrame { offset(-1) { } + + void dump(std::ostream &os) { + os << (this->module ? this->module : "?"); + if (this->function != NULL) { + os << ": " << this->function; + } + if (this->offset >= 0) { + os << "+0x" << std::hex << this->offset << std::dec; + } + if (this->filename != NULL) { + os << ": " << this->filename; + if (this->linenumber >= 0) { + os << ":" << this->linenumber; + } + } + } }; class StackFrame : public RawStackFrame {