X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=trace_parser.hpp;h=15b0ccb9b03f0964b5ce1c5418488e23bfb5afe7;hb=3a8ffad2f31f4438e19dd5a0f1c068e1fdffdeea;hp=a000986c3631299292745dc213dca060406938d2;hpb=712429a22a8cc9d51b620d433ade6d327fbabbf0;p=apitrace diff --git a/trace_parser.hpp b/trace_parser.hpp index a000986..15b0ccb 100644 --- a/trace_parser.hpp +++ b/trace_parser.hpp @@ -29,6 +29,7 @@ #include #include +#include #include "trace_file.hpp" #include "trace_format.hpp" @@ -57,6 +58,17 @@ protected: typedef std::vector BitmaskMap; BitmaskMap bitmasks; + typedef std::set TraceOffsets; + TraceOffsets m_callSigOffsets; + TraceOffsets m_structSigOffsets; + TraceOffsets m_enumSigOffsets; + TraceOffsets m_bitmaskSigOffsets; + + typedef std::map CallNumOffsets; + CallNumOffsets m_callNumOffsets; + + bool m_supportsSeeking; + unsigned next_call_no; public: @@ -74,7 +86,7 @@ public: bool supportsOffsets() const { - return file-supportsOffsets(); + return file->supportsOffsets(); } File::Offset currentOffset() @@ -87,6 +99,28 @@ public: file->setCurrentOffset(offset); } + bool callWithSignature(const File::Offset &offset) const; + bool structWithSignature(const File::Offset &offset) const; + bool enumWithSignature(const File::Offset &offset) const; + bool bitmaskWithSignature(const File::Offset &offset) const; + + unsigned currentCallNumber() const + { + return next_call_no; + } + + void setCurrentCallNumber(unsigned num) + { + next_call_no = num; + } + + int percentRead() + { + return file->percentRead(); + } + + Call *scan_call(); + protected: void parse_enter(void); @@ -125,6 +159,45 @@ protected: unsigned long long read_uint(void); inline int read_byte(void); + +protected: + void scan_enter(void); + + Call *scan_leave(void); + + bool scan_call_details(Call *call); + + void scan_arg(Call *call); + + void scan_value(void); + + void scan_sint(); + + void scan_uint(); + + void scan_float(); + + void scan_double(); + + void scan_string(); + + void scan_enum(); + + void scan_bitmask(); + + void scan_array(void); + + void scan_blob(void); + + void scan_struct(); + + void scan_opaque(); + + void skip_string(void); + + void skip_uint(void); + + inline void skip_byte(void); };