namespace trace {
+// Should match Call::no
+typedef unsigned CallNo;
+
+
typedef unsigned Id;
const char *name;
unsigned num_args;
const char **arg_names;
- bool backtrace;
};
void visit(Visitor &visitor);
};
-class StackFrame {
-public:
- String* module;
- String* function;
- String* filename;
- String* linenumber;
- String* offset;
- StackFrame() :
- module(NULL),
- function(NULL),
- filename(NULL),
- linenumber(NULL),
- offset(NULL)
- {}
- ~StackFrame();
+struct RawStackFrame {
+ Id id;
+ const char * module;
+ const char * function;
+ const char * filename;
+ int linenumber;
+ long long offset;
+ RawStackFrame() :
+ module(0),
+ function(0),
+ filename(0),
+ linenumber(-1),
+ offset(-1)
+ {
+ }
};
-class Backtrace {
+class StackFrame : public RawStackFrame {
public:
- std::vector<StackFrame*> frames;
- ~Backtrace();
- void addFrame(StackFrame* frame);
+ ~StackFrame();
};
+typedef std::vector<StackFrame *> Backtrace;
+
class Visitor
{
public:
public:
unsigned thread_id;
unsigned no;
- FunctionSig *sig;
+ const FunctionSig *sig;
std::vector<Arg> args;
Value *ret;
CallFlags flags;
Backtrace* backtrace;
- Call(FunctionSig *_sig, const CallFlags &_flags, unsigned _thread_id) :
+ Call(const FunctionSig *_sig, const CallFlags &_flags, unsigned _thread_id) :
thread_id(_thread_id),
sig(_sig),
args(_sig->num_args),