]> git.cworth.org Git - apitrace/blobdiff - common/trace_model.hpp
More WGL support. It's ugly and the resulting code probably doesn't compile.
[apitrace] / common / trace_model.hpp
index 7c4cdc78f221528e1b0fa7df7dd7b326b790c24c..4a9ca476f262580f6c32a83ce6ba882f41630935 100644 (file)
 namespace trace {
 
 
+// Should match Call::no
+typedef unsigned CallNo;
+
+
 typedef unsigned Id;
 
 
@@ -49,7 +53,6 @@ struct FunctionSig {
     const char *name;
     unsigned num_args;
     const char **arg_names;
-    bool backtrace;
 };
 
 
@@ -349,30 +352,30 @@ public:
     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:
@@ -488,14 +491,14 @@ class Call
 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),