]> git.cworth.org Git - apitrace/blobdiff - common/trace_parser.hpp
retrace: Implement glxCopySubBufferMESA
[apitrace] / common / trace_parser.hpp
index d8c5915ea3d8e3976c1b2d38e33d8e8f57a21d53..7bf0a7dce1058f2fd111ab45b2aa5ba5f1d34ca7 100644 (file)
@@ -33,6 +33,7 @@
 #include "trace_file.hpp"
 #include "trace_format.hpp"
 #include "trace_model.hpp"
+#include "trace_api.hpp"
 
 
 namespace trace {
@@ -70,23 +71,26 @@ protected:
         // Offset in the file of where signature was defined.  It is used when
         // reparsing to determine whether the signature definition is to be
         // expected next or not.
-        File::Offset offset;
+        File::Offset fileOffset;
     };
 
     typedef SigState<FunctionSigFlags> FunctionSigState;
     typedef SigState<StructSig> StructSigState;
     typedef SigState<EnumSig> EnumSigState;
     typedef SigState<BitmaskSig> BitmaskSigState;
+    typedef SigState<StackFrame> StackFrameState;
 
     typedef std::vector<FunctionSigState *> FunctionMap;
     typedef std::vector<StructSigState *> StructMap;
     typedef std::vector<EnumSigState *> EnumMap;
     typedef std::vector<BitmaskSigState *> BitmaskMap;
+    typedef std::vector<StackFrameState *> StackFrameMap;
 
     FunctionMap functions;
     StructMap structs;
     EnumMap enums;
     BitmaskMap bitmasks;
+    StackFrameMap frames;
 
     FunctionSig *glGetErrorSig;
 
@@ -94,6 +98,7 @@ protected:
 
 public:
     unsigned long long version;
+    API api;
 
     Parser();
 
@@ -145,6 +150,9 @@ protected:
 
     bool parse_call_details(Call *call, Mode mode);
 
+    bool parse_call_backtrace(Call *call, Mode mode);
+    StackFrame * parse_backtrace_frame(Mode mode);
+
     void adjust_call_flags(Call *call);
 
     void parse_arg(Call *call, Mode mode);
@@ -193,6 +201,9 @@ protected:
     Value *parse_opaque();
     void scan_opaque();
 
+    Value *parse_repr();
+    void scan_repr();
+
     const char * read_string(void);
     void skip_string(void);